compiling gcc 4.1.2 to get gfortran-4.1.2

I need to do this to use thermocalc tq on my linux computer (debian squeeze). 1) Download I think I downloaded and untarred (I had these on my computer from previous time) gcc-4.1.2.tar.gz gcc-fortran-4.1.2.tar.gz (not sure this is needed — I think other folder contains everything!?) 2) Install prerequisites 3) Make a new directory in [...]

Octave/ Matlab is fun – Enter the Matrix

f = rot90((diag((ones(5,1)))) + hankel(zeros(5,1),2*(ones(5,1))),1) warning: hankel: column wins anti-diagonal conflict f = 0 2 2 2 3 0 0 2 3 2 0 0 1 2 2 0 1 0 0 2 1 0 0 0 0 hess(diag((ones(4,1)))) ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 [...]

Java Triangle

Some Java for your Christmas present… Here is a short Java program to calculate triangular numbers, (the sequence: 1 3 6 10 15 21 … ). /******************************************** * Program to calculate triangular numbers * inefficiently * Mathew Peet * Christmas 2009 * *********************************************/ public class Triangular { public static long tri(int n) { int total [...]

My second g++/cpp program – Using a Makefile

I downloaded the example files from here: http://www.cs.bu.edu/teaching/cpp/separate-compilation/ This demonstration explains how to compile using the make file. In this example you split up the program into separate modules, and use a make file to compile. This has the advantage that after making a change, only that part of the program needs to be recompiled. [...]

My first g++/cpp program

test.cpp is a text file containing: #include using namespace std; int main() { cout<<"test test"<<endl; return 0; } This is compiled using the command: g++ -o test test.cpp

Follow

Get every new post delivered to your Inbox.