Library/header path for ./configure


 
Thread Tools Search this Thread
Top Forums Programming Library/header path for ./configure
# 1  
Old 03-25-2015
Library/header path for ./configure

Hello,
I am always confused about adding library path for ./configure when compiling software under Linux Debian based OS. For example the README of the software tells
Code:
  --with-boost=PATH       specify directory for the boost header files
  --with-mpi=PATH         specify prefix directory for the installed MPI parallel computing library
  --with-gtest=PATH       specify prefix directory for the installed gtest library
  --google sparsehash is also recommended

What I did is like:
Code:
./configure --with-boost=/usr/local/include --with-mpi=/usr/lib/openmpi

And sparsehash is installed at /usr/include/google/sparsehash

Under directory
Code:
/usr/include/google

there are many header files including the subdirectory
Code:
/usr/include/google/sparsehash

which also has many header files.
My question is how to correctly set the PATHs for sparsehash:
Code:
/usr/include    #which is one of the default searching PATHs and no need to assign explicitly??
/usr/include/google 
or
/usr/include/google/sparsehash

What is the rule for those cutomized library PATHs setting on top of the environment variable LD_LIBRARY_PATH, especially it is not clear to use the headers or libraries?
Thanks a lot!

Last edited by yifangt; 03-31-2015 at 04:54 PM..
# 2  
Old 03-25-2015
Depends what the code's including.

If they are doing #include <sparesehash-header.h> and you find it in /usr/include/sparsehash/sparsehash-header.h then you need to add that to the include path.

If they are doing #include <sparesehash/sparesehash-header.h> then you don't need to add it to the include path.

etc.

How to add it depends on the ./configure script as well. See ./configure --help.
# 3  
Old 03-25-2015
Thanks Corona688!
The sparsehash part is clear now!
I came to openmpi for which there are many folders containing the header mpi.hThe ./configure --help tells to use the prefix directory of the library which seems quite vague to me.
Code:
/usr/lib/openmpi
/usr/lib64/openmpi
/usr/include/openmpi-x86_64
/usr/lib64/compat-openmpi-psm
/usr/lib64/compat-openmpi
/usr/lib64/compat-openmpi-psm

I take openmpi as blackbox for granted as I am not familiar with it at all. How do I choose the correct path for similar situation? Thanks again!
# 4  
Old 03-25-2015
Take a look at what those folders are with ls -l. A lot of them are probably symlinks to the final location -- i.e. there could be more than one right answer. I would assume the most generic one, /usr/lib/openmpi, would be the one to stick with, but that's only a guess.
# 5  
Old 03-26-2015
Thanks!
Most of them are symlinks.
You are right the path is /usr/lib/openmpi where mpi.h is located under the sub-folder /include Thanks again!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

configure library package for --host architecture

I am trying to decode "configure" script for "bluez" package as far as how are "configure" options for cross-compiling passed to libtoool or GCC to build C++ library. As far as I can tell the "configure" triplet analysis (case) has no options to analyze anything with "linux" in it ,therefore... (5 Replies)
Discussion started by: anne
5 Replies

2. Programming

Configure: error: X Window system libraries and header files are required

I am trying to compile thunar 1.8.4. It is giving me this error. configure: error: X Window system libraries and header files are required Ubuntu Mate 18.04 (2 Replies)
Discussion started by: drew77
2 Replies

3. Programming

C++ library path

Hello, How to set up the path for downloaded C/C++ libraries (or, header files) so that they can be included like system headers (stdio.h or iostream)? The libraries/headers are from a package containing different folders each has different sets of headers and put in... (1 Reply)
Discussion started by: yifangt
1 Replies

4. UNIX for Dummies Questions & Answers

Configure $PATH in /.bash_profile or /etc/paths?

Hi - I am trying to include the MSQ.exe that I have downloaded for the sake of learning. My current /.bash_profile file reads: PATH=/Library/Frameworks/Python.framework/Versions/3.1/bin:/Applications/XAMPP/xamppfiles/bin:$PATH export PATH ----------------------------------- ... (4 Replies)
Discussion started by: Alexander4444
4 Replies

5. Linux

./configure problem for libsf library due to apparently missing libdb library.

Hello, ./configure script fails to configure libsf. Please check the following last few lines of configure script error. checking for db1/db.h... no checking for db.h... yes checking for dbopen in -ldb1... no configure: error: No libdb? No libsf. But find command shows the following; ... (4 Replies)
Discussion started by: vectrum
4 Replies

6. Solaris

configure: error: no acceptable ld found in $PATH

When i configure apache(2.2.15) on solaris-8 server it producing following error <configure: error: no acceptable ld found in $PATH configure failed for srclib/apr > please help me any to fix this error. :confused: ---------- Post updated at 09:44 PM ---------- Previous update was... (0 Replies)
Discussion started by: kalpeer
0 Replies

7. UNIX for Advanced & Expert Users

Changing a header in a shared library

Hello, Does changing a header in a shared library under Solaris (say adding a new class data member) will result in not only compiling that library but all of the libraries that depend on that lib that was changed because of the change in the object's size? What about adding a virtual function?... (0 Replies)
Discussion started by: Linker
0 Replies

8. HP-UX

removing library path

Hi Everyone I have written an installer dependant on several shared libraries. I am attempting to strip the full path from these dependant libraries using the chatr command via a script file but am having no success. Running ldd on the intaller exe fails with the following error. Cant open... (4 Replies)
Discussion started by: C3000
4 Replies

9. UNIX for Dummies Questions & Answers

configure script can't find a library

I installed libxml2 library from source and it installed itself in /usr/local/lib i added /usr/local/lib to ld.so.conf and ran a ldconfig ( as root ) then i tried to compile tablix-0.0.3 wich does require the installed version of libxml2 i ran ./configure ( as normal user ) and i get the... (2 Replies)
Discussion started by: progressdll
2 Replies

10. UNIX for Dummies Questions & Answers

library path

How do you get an application to use an alternate library? Dave:confused: (2 Replies)
Discussion started by: nucca
2 Replies
Login or Register to Ask a Question