Hi All
i am using Elmer and i want to defined a user defined solver, so i just wrote the code in fortran and compile it with the compiler wrapper provided by Elmer, using elmerf90 mysolver.f90 -o mysolver, but the problem is that i want to link another library to the user defined solver. In other program written using Fortran, i just link it when i build the code using cmake, the cmake file as follows
find_package(precice REQUIRED CONFIG)
add_executable(solverdummy solverdummy.f90)
So my preinstalled library precice is linked to the fortran executable, so i want to link the User defined solver with this precice library but i do not have access to the wrapper script to modify it. So how to do that. Thanks in advance.
Hisham
Compiling User defined solver
-
- Posts: 2400
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: Compiling User defined solver
In fortran if you want to compile several programs into one exectuable you list them all
elmerf90 proga.f90 progb.f90 progc.f90 -o myprog
if the other programs(libraries) are compiled objects then provide the compiled object files
elmerf90 proga.f90 -o myprog progb.o progc.o
if they are compiled libraries then
elmerf90 -o output mainprogram.f90 libABC.a
elmerf90 proga.f90 progb.f90 progc.f90 -o myprog
if the other programs(libraries) are compiled objects then provide the compiled object files
elmerf90 proga.f90 -o myprog progb.o progc.o
if they are compiled libraries then
elmerf90 -o output mainprogram.f90 libABC.a