
Compilation TOUGHREACT on Windows using gfortran and Cygwin
I am having some problems with compiling the original source code of TOUGHREACT.
I have tried using all of the compiler flags and the ones suggested on this forum. The errors i get are usually these two
inichm_v3.o:inichm_v3.f:(.text+0x18d): relocation truncated to fit: R_X86_64_PC32 against symbol `chemnode_' defined in COMMON section in inichm_v3.o
unrecognized -a option `ck_size'
collect2.exe: error: ld returned 1 exit status
I tried for so long to get a fix but have been unsuccessful thus far. Anyone with an idea of where i am going wrong?
Thank you
-
Last week, I was able to solve these problems and want to leave a record of my experience in case any other person needs it.
- The flag “-stack_size," is no longer recognized by some compilers like MINGW+MSYS2, so this has to be changed just to "-stack,"
- The problem with the inichm_v3.o file (or any other file with the same error message) arose after I compiled some ".f" files without any of the recommended flags. So, when I tried to link all the ".o" files to create an executable, this error popped up. In my case was better to compile and link the executable in a single step, using the recommended flags provided in the "makefiles" directory. (e.g.: gfortran -o X2_eos9_n.exe -g -O2 -fstack-arrays -fdefault-integer-8 -fdefault-real-8 -fdefault-double-8 -falign-loops=16 -malign-double -fwhole-file -fopenmp -Wall -Wl,-stack,0x80000000 -fno-align-commons t2cg22_v3.f t2f_v3.f t2solv_v3.f meshm_v3.f multi_v3.f thermcond_v3.f wellboresim.f inichm_v3.f geochem_v3.f readtherm_hkf_v3.f readsolu_v3.f adsorption_v3.f heatcapacity_v3.f aqueous_kin_v3.f newton_v3.f rctprop_v3.f diffusion_lhs.f lapack_solver_int8.f treact_v3.f main_v3.f eos9_v3.f)