Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvcc fatal : Unknown option 'fPIC' #1753

Closed
pandaandyy opened this issue Jan 10, 2023 · 27 comments
Closed

nvcc fatal : Unknown option 'fPIC' #1753

pandaandyy opened this issue Jan 10, 2023 · 27 comments

Comments

@pandaandyy
Copy link

When I use make command I get this error

[ 90%] Building CXX object src/CMakeFiles/colmap.dir/colmap_autogen/UYX5XTB5RZ/qrc_resources.cpp.o [ 90%] Linking CXX static library libcolmap.a [ 90%] Built target colmap [ 90%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o nvcc fatal : Unknown option 'fPIC' make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o] Error 1 make[1]: *** [src/CMakeFiles/colmap_cuda.dir/all] Error 2 make: *** [all] Error 2
How can I fix this error?Thanks

@NotMorven
Copy link

@yyspyysp
Hi, I got the same problem with you. Do you solve this problem?

@pandaandyy
Copy link
Author

pandaandyy commented Jan 12, 2023 via email

@everRoc
Copy link

everRoc commented Jan 31, 2023

@ahojnnes hello, could you give some suggestions to fix this error? Thanks!

@rmadan2
Copy link

rmadan2 commented Feb 1, 2023

Hi, I am facing the same issue as well. Can the -fPIC flag be removed from CMakeLists.txt?

@ahojnnes
Copy link
Contributor

ahojnnes commented Feb 1, 2023

Which version of CUDA/GCC are you using to compile colmap?

@rmadan2
Copy link

rmadan2 commented Feb 1, 2023

CUDA: Cuda compilation tools, release 10.1, V10.1.243
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

@rmadan2
Copy link

rmadan2 commented Feb 1, 2023

P.S: I tried removing the -fPIC flag, and it compiled all the way to 93%, (sift_gpu compiles as well), but then it crashes with errors arising here:

nvcc fatal   : Unknown option 'fPIC'
nvcc fatal   : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:63: src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:76: src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o] Error 1
nvcc fatal   : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:102: src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:661: src/CMakeFiles/colmap_cuda.dir/all] Error 2

@everRoc
Copy link

everRoc commented Feb 3, 2023

P.S: I tried removing the -fPIC flag, and it compiled all the way to 93%, (sift_gpu compiles as well), but then it crashes with errors arising here:

nvcc fatal   : Unknown option 'fPIC'
nvcc fatal   : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:63: src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:76: src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o] Error 1
nvcc fatal   : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/build.make:102: src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:661: src/CMakeFiles/colmap_cuda.dir/all] Error 2

hi, do you know how to remove -fPIC flag now?

@rmadan2
Copy link

rmadan2 commented Feb 3, 2023

You can comment it out in CMakeLists.txt

@cheylong
Copy link

I solve it by update cmake version to 3.25.X

@pandaandyy
Copy link
Author

@cheylong i update cmake to 3.25.2,but i still have this error
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o
[ 34%] Building CXX object src/CMakeFiles/colmap_cuda.dir/mvs/patch_match.cc.o
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o] Error 1
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o] Error 1

@pandaandyy
Copy link
Author

@ahojnnes i update cmake to 3.25.2,but i still have this error
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o
[ 34%] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o
[ 34%] Building CXX object src/CMakeFiles/colmap_cuda.dir/mvs/patch_match.cc.o
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_prng.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/gpu_mat_ref_image.cu.o] Error 1
nvcc fatal : Unknown option 'fPIC'
make[2]: *** [src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o] Error 1

@yuzewang1998
Copy link

i have the same error with cmake 3.25 and 3.16

@bobododosjl
Copy link

I have the same problem with cmake 3.25.2

@dadwadw233
Copy link

I have the same problem with cmake 3.16.3 and Cuda 11.7

@everRoc
Copy link

everRoc commented Mar 20, 2023 via email

@yhz0614
Copy link

yhz0614 commented Mar 26, 2023

I have the same problem,Do you solve this problem now?

@yhz0614
Copy link

yhz0614 commented Mar 28, 2023

I solve it by update CUDA version to 11.3
environment : ubuntu16.04 CUDA11.3 gcc9.4 cmake5.23.5

@XiaoHaoPan
Copy link

I have the same problem with cmake 3.25.2

@SudoShutdownNow
Copy link

I solve this by installing cmake 3.26.3.

@everRoc
Copy link

everRoc commented Apr 24, 2023 via email

@mch0dmin
Copy link

i solve this issue by update cuda version to 11.3

environment : ubuntu18.04 cuda11.3 gcc7.5.9 cmake3.26.4

export CUDA_HOME="/usr/local/cuda-11.3"
export LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:${LD_LIBRARY_PATH}"
export PATH="/usr/local/cuda-11.3/bin:${PATH}"

cd colmap
mkdir build
cd build
cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=native
ninja
sudo ninja install

i hope it can help you.

@everRoc
Copy link

everRoc commented Jun 15, 2023 via email

@yujianing0210
Copy link

I solve this by installing cmake 3.26.3.

This worked for me as well, thx!!

@everRoc
Copy link

everRoc commented Jul 9, 2023 via email

@sarlinpe
Copy link
Contributor

This might help: #2022

@AlbertHuyb
Copy link

For my case, it is because cmake find Qt5 libraries under the anaconda directory.

When I modify the paths to those libraries under /usr/lib/x86_64-linux-gnu/cmake/, everything works.

If you want to modify it, try to use the ccmake tool, which provides a GUI to modify the configurations.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests