montagdude / libxfoil

2-dimensional airfoil aerodynamics library
GNU General Public License v2.0
12 stars 4 forks source link

Install problems: /usr/bin/ld: cannot find -lxfoil #2

Closed agaier closed 4 years ago

agaier commented 4 years ago

Hey looks like a really useful project -- right now I am doing everything in xfoil by passing files in the command line, this could really help me out. I am having trouble getting it installed though. I don't know that much about cmake and just following the instructions in 'INSTALL'

Build and install library with C and Fortran bindings

mkdir build cd build cmake -DCMAKE_BUILD_TYPE="Release" .. make

then I get errors:

on linux:

 make
Linking C executable c_example
/usr/bin/ld: cannot find -lxfoil
collect2: error: ld returned 1 exit status
make[2]: *** [c_example] Error 1
make[1]: *** [CMakeFiles/c_example.dir/all] Error 2
make: *** [all] Error 2

on mac:

make
[  7%] Linking C executable c_example
ld: library not found for -lxfoil
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [c_example] Error 1
make[1]: *** [CMakeFiles/c_example.dir/all] Error 2
make: *** [all] Error 2

am I doing this in the wrong order? how do I get lxfoil?

thanks!

montagdude commented 4 years ago

-lxfoil is libxfoil. It looks like it is failing while trying to build the example programs. You can disable building the examples by adding this in your cmake invocation (for example, if using the provided build_libxfoil.sh script):

-DBUILD_EXAMPLES:BOOL=False \

Let me know if the build completes successfully after doing this.

agaier commented 4 years ago

Thanks! I was able to build after inserting that into the build_libxfoil.sh script

montagdude commented 4 years ago

I made some improvements to the build scripts so the examples should build correctly by default now. Can you try again with -DBUILD_EXAMPLES:BOOL=False removed from your build_libxfoil.sh (or set it to True)?

agaier commented 4 years ago

awesome thanks! just cloning the repo and running ./build_libxfoil.sh everything sets up nice