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

cmake examples failure on master: OpenMP::OpenMP_CXX not found #2046

Closed
WilliamTambellini opened this issue Jan 22, 2018 · 7 comments
Closed

Comments

@WilliamTambellini
Copy link
Contributor

WilliamTambellini commented Jan 22, 2018

Hi
On recent master, cmake fails with such messages:

CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_bagging_cpu" links to target "OpenMP::OpenMP_CXX" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:13 (add_executable)

CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_rbm_cpu" links to target "OpenMP::OpenMP_CXX" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:45 (add_executable)

CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_perceptron_cpu" links to target "OpenMP::OpenMP_CXX" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:41 (add_executable)

CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_neural_network_cpu" links to target "OpenMP::OpenMP_CXX"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:37 (add_executable)

CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_logistic_regression_cpu" links to target
  "OpenMP::OpenMP_CXX" but the target was not found.  Perhaps a
  find_package() call is missing for an IMPORTED target, or an ALIAS target
  is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:29 (add_executable)


CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_kmeans_cpu" links to target "OpenMP::OpenMP_CXX" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:25 (add_executable)


CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_naive_bayes_cpu" links to target "OpenMP::OpenMP_CXX" but
  the target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:33 (add_executable)


CMake Error at CMakeLists.txt:42 (_add_executable):
  Target "example_deep_belief_net_cpu" links to target "OpenMP::OpenMP_CXX"
  but the target was not found.  Perhaps a find_package() call is missing for
  an IMPORTED target, or an ALIAS target is missing?
Call Stack (most recent call first):
  machine_learning/CMakeLists.txt:17 (add_executable)

OS: ubuntu 16
Tried with cmake 3.5 and 3.9.

Perhaps a find openmp is missing ?
Kind

@9prady9
Copy link
Member

9prady9 commented Jan 23, 2018

@WilliamTambellini

I did a clean build on Ubuntu 16.04 few hours back and I didn't have any issues with OpenMP being not found. My machine uses CMake 3.5.1 that I got from apt package manager. We have FindOpenMP.cmake script in the CMakeModules path of ArrayFire repository and it is included properly in the root CMake file. May be your OpenMP is installed in a non-standard path ?

Did you copy the examples file some where else and then tried to build the examples ?

@WilliamTambellini
Copy link
Contributor Author

Thanks.

  • I ve checked and libgomp is installed in the standard ubuntu location: /usr/lib/x86_64-linux-gnu/libgomp.so.1
  • I did nt copy the examples : I m just trying to build the the examples from a .sh/.run AF installer (arrayfire-no-gl-3.6.0-beta1.sh), which extracts files in (cwd)/share/ArrayFire/examples
    In the /share/ArrayFire/cmake/ cmake files, where are you searching for openmp ?
    W.

@WilliamTambellini WilliamTambellini changed the title cmake failure on master: OpenMP::OpenMP_CXX not found cmake examples failure on master: OpenMP::OpenMP_CXX not found Jan 23, 2018
@9prady9
Copy link
Member

9prady9 commented Jan 24, 2018

Yes, that is the location where I found the libgomp.so.1 file on my machine as well.

That could be because there is no FindOpenMP.cmake file under examples\CMakeModules which is installed to share\ArrayFire\examples. None of the examples directly link to OpenMP. I wonder why examples are looking for the OpenMP target, I will look into it.

@umar456
Copy link
Member

umar456 commented Jan 24, 2018

I think the problem is with the installer and the arrayfire-config generated by cmake. @9prady9 try to install the library in a docker container and see if you run into the same issue when you try to build the examples.

@9prady9
Copy link
Member

9prady9 commented Jan 24, 2018

I generated the installer using master HEAD and don't get openmp errors on regular machine. I have to try it on docker and see what happens there.

@9prady9
Copy link
Member

9prady9 commented Jan 24, 2018

I didn't get such errors with docker either.

@WilliamTambellini Please share some details of the Linux distribution you are using and CMake version.

@9prady9
Copy link
Member

9prady9 commented May 8, 2018

v3.6 is out, @WilliamTambellini can you please check if you can reproduce the problem with v3.6 and reopen if the problem persists. Closing the issue for now.

@9prady9 9prady9 closed this as completed May 8, 2018
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

3 participants