quickk
July 31st, 2011, 03:03 AM
Hi everyone,
I'm trying to use a minimum perfect hash library called cmph. I've compiled it and installed the library to the folder /opt/local/lib. Then I added that folder to the /etc/ld.so.conf file like this:
/opt/local/lib
include /etc/ld.so.conf.d/*.conf
(that last line was already there)
I then ran "sudo ldconfig" to refresh the library cache.
The problem is that when I try to compile my program, I get the message that the cmph library cannot be found
mpiifort -fPIC -o sim sim.f90 kinds_module.o variables_module.o basis_module.o Hamiltonian_module.o mph.o -lcmph
ld: cannot find -lcmph
However when I instead use the -L/opt/local/lib option everything works great: (I get no errors, and can run my program)
mpiifort -fPIC -o sim sim.f90 kinds_module.o variables_module.o basis_module.o Hamiltonian_module.o mph.o -L/opt/local/lib -lcmph
I obviously don't understand something. I thought that both approaches would work equally well. Any comments?
I'm trying to use a minimum perfect hash library called cmph. I've compiled it and installed the library to the folder /opt/local/lib. Then I added that folder to the /etc/ld.so.conf file like this:
/opt/local/lib
include /etc/ld.so.conf.d/*.conf
(that last line was already there)
I then ran "sudo ldconfig" to refresh the library cache.
The problem is that when I try to compile my program, I get the message that the cmph library cannot be found
mpiifort -fPIC -o sim sim.f90 kinds_module.o variables_module.o basis_module.o Hamiltonian_module.o mph.o -lcmph
ld: cannot find -lcmph
However when I instead use the -L/opt/local/lib option everything works great: (I get no errors, and can run my program)
mpiifort -fPIC -o sim sim.f90 kinds_module.o variables_module.o basis_module.o Hamiltonian_module.o mph.o -L/opt/local/lib -lcmph
I obviously don't understand something. I thought that both approaches would work equally well. Any comments?