KNITRO with Fortran on Linux

65 views
Skip to first unread message

sergei

unread,
Jun 8, 2009, 10:41:02 PM6/8/09
to KNITRO Nonlinear Optimization Solver
Hi,
I've been successfully using KNITRO from my Fortran code in Windows
for a while, and now I've been trying to parallelize my program and
run it on the linux server. I've tried to compile the Fortran example
that is provided with the linux version of KNITRO, but without much
success.
I've changed the compiler and linker in the example from g77 to ifort
(the latter is used in the Windows example). When I run make, I get
the following error messages from the linker:

ld: error in ../../lib/libknitro600.a(.eh_frame); no .eh_frame_hdr
table will be created.
exampleProgram.o: In function `MAIN__':
exampleProgram.f:(.text+0xe0): undefined reference to
`ktrf_open_instance_'
exampleProgram.f:(.text+0xe5): undefined reference to
`ktrf_load_param_file_'
exampleProgram.f:(.text+0x140): undefined reference to
`ktrf_init_problem_'
exampleProgram.f:(.text+0x182): undefined reference to `ktrf_solve_'
exampleProgram.f:(.text+0x1dd): undefined reference to
`ktrf_close_instance_'
make: *** [example_static] Error 1

Any help would be very appreciated!

Sergei

wa...@ziena.com

unread,
Jun 9, 2009, 12:20:49 PM6/9/09
to KNITRO Nonlinear Optimization Solver
Sergei,

There is probably some mismatch in the Fortran compiler you are using
compared to the one we used for our Fortran examples. Typically
function headers and other things may need to change depending on the
Fortran compiler you are using when calling a C library from Fortran.
You should look in the ifort manual to see how the KNITRO C function
headers should be defined and then make the appropriate changes to
the "knitro_fortran.c" interface file.

-Richard
Reply all
Reply to author
Forward
0 new messages