ADIOS2 icon indicating copy to clipboard operation
ADIOS2 copied to clipboard

Build breaks with cmake-3.24.0: install into a stage directory is broken

Open yurivict opened this issue 3 years ago • 18 comments

Describe the bug After cmake was upgraded from 3.23.3 to 3.24.0 adios2-2.8.3 now breaks:

-- Found adios2: /wrkdirs/usr/ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-config.cmake (found version "2.8.3") found components: C CXX MPI 
CMake Error at CMakeLists.txt:9 (find_package):
  Found package configuration file:

    /wrkdirs/usr/ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-config.cmake

  but it set adios2_FOUND to FALSE so package "adios2" is considered to be
  NOT FOUND.  Reason given by package:

  The following imported targets are referenced, but are missing: ffs::ffs

adios2-2.8.3.log.txt

clang-14 OS: FreeBSD 13.1

yurivict avatar Sep 25 '22 06:09 yurivict

@yurivict there is a configure error with ZFP in the log txt that you attached, can you try to address this by ADIOS2_USE_ZFP=OFF and try to reproduce this error

vicentebolea avatar Sep 26 '22 16:09 vicentebolea

I just reproduced this error

vicentebolea avatar Sep 26 '22 22:09 vicentebolea

We have ZFP in a package:

zfp-1.0.0 High throughput library for compressed floating-point arrays

Why not use the external ZFP package instead?

yurivict avatar Sep 27 '22 01:09 yurivict

We have ZFP in a package:

zfp-1.0.0 High throughput library for compressed floating-point arrays

Why not use the external ZFP package instead?

Nevermind, the ZFP was unrelated.

vicentebolea avatar Sep 27 '22 01:09 vicentebolea

The current master branch still fails with cmake-3.24.0:

CMake Error at CMakeLists.txt:9 (find_package):
  By not providing "Findadios2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "adios2", but
  CMake did not find one.

  Could not find a package configuration file provided by "adios2" with any
  of the following names:

    adios2Config.cmake
    adios2-config.cmake

  Add the installation prefix of "adios2" to CMAKE_PREFIX_PATH or set
  "adios2_DIR" to a directory containing one of the above files.  If "adios2"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/tmp.Rf5mJBXG/CMakeFiles/CMakeOutput.log".
Failed
CMake Error at cmake/install/post/cmake_install.cmake:44 (message):
  generate-adios2-config.sh returned 1, should be 0
Call Stack (most recent call first):
  cmake_install.cmake:53 (include)

yurivict avatar Sep 28 '22 03:09 yurivict

@yurivict

vicentebolea avatar Sep 28 '22 15:09 vicentebolea

@yurivict we seem to have resolved this issue for Linux/Mac in the last PR. We do not have a FreeBSD machine to test this, so there is little we can do about it.

One thing could be: whats your bash version?

vicentebolea avatar Sep 28 '22 15:09 vicentebolea

bash-5.1.16

yurivict avatar Sep 28 '22 18:09 yurivict

Could you add set -x in a line after the shebang in cmake/install/post/generate-adios2-config.sh.in, reconfigure and post the output of cmake --install here?

vicentebolea avatar Sep 28 '22 19:09 vicentebolea

-- Installing: /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-config-version.cmake
-- Installing: /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-config-common.cmake
-- Installing: /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-targets.cmake
-- Installing: /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-targets-release.cmake
-- Installing: /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local/lib/cmake/adios2/adios2-config.cmake
+ unset MAKEFLAGS
+ unset MAKE
+ PREFIX=/usr/local
+ '[' / '!=' / ']'
+ shift
+ CMAKE=/usr/local/bin/cmake
+ SOURCE_DIR=/disk-samsung/freebsd-ports/misc/adios2/work/ADIOS2-91207a2fb/cmake/install/post/adios2-config-dummy
++ mktemp -d
+ BUILD_DIR=/tmp/tmp.9xUqBz3Q
+ pushd /tmp/tmp.9xUqBz3Q
+ '[' 1 -eq 1 ']'
+ export CC=/usr/local/bin/mpicc
+ CC=/usr/local/bin/mpicc
+ '[' 1 -eq 1 ']'
+ export CXX=/usr/local/bin/mpicxx
+ CXX=/usr/local/bin/mpicxx
+ '[' 1 -eq 1 ']'
+ export FC=/usr/local/bin/mpif90
+ FC=/usr/local/bin/mpif90
+ export adios2_DIR=/usr/local/lib/cmake/adios2
+ adios2_DIR=/usr/local/lib/cmake/adios2
+ '[' -n '' ']'
+ echo 'Configuring adios2-config dummy CMake project'
+ /usr/local/bin/cmake -G 'Unix Makefiles' /disk-samsung/freebsd-ports/misc/adios2/work/ADIOS2-91207a2fb/cmake/install/post/adios2-config-dummy
/tmp/tmp.9xUqBz3Q ~/.build
Configuring adios2-config dummy CMake project
-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/mpicxx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:9 (find_package):
  By not providing "Findadios2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "adios2", but
  CMake did not find one.

  Could not find a package configuration file provided by "adios2" with any
  of the following names:

    adios2Config.cmake
    adios2-config.cmake

  Add the installation prefix of "adios2" to CMAKE_PREFIX_PATH or set
  "adios2_DIR" to a directory containing one of the above files.  If "adios2"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/tmp/tmp.9xUqBz3Q/CMakeFiles/CMakeOutput.log".
+ echo Failed
Failed
+ exit 1
CMake Error at cmake/install/post/cmake_install.cmake:44 (message):
  generate-adios2-config.sh returned 1, should be 0
Call Stack (most recent call first):
  cmake_install.cmake:53 (include)


yurivict avatar Sep 30 '22 06:09 yurivict

is there a adios2-config.cmake file in /usr/local/lib/cmake/adios2?

vicentebolea avatar Sep 30 '22 15:09 vicentebolea

oh I see the issue:

You installed ADIOS2 in /disk-samsung/freebsd-ports/misc/adios2/work/stage/usr/local however adios2_DIR was seted to /usr/local. can you try to cmake --install with an absolute path?

vicentebolea avatar Sep 30 '22 15:09 vicentebolea

In the ports framework the package has to be installed into a stage directory.

yurivict avatar Oct 27 '22 05:10 yurivict

@yurivict can you try with the latest master.

vicentebolea avatar Jan 15 '23 12:01 vicentebolea

2.9.0 still has this problem.

Why is adios2-config dummy configured after install? Is this intended?

yurivict avatar Apr 01 '23 06:04 yurivict

In order for the package to be found after the 'install' target the stage directory should be added to cmake's search path.

In its current form ADIOS2 is broken when stage directory is used.

yurivict avatar Apr 01 '23 06:04 yurivict

Why is adios2-config dummy configured after install? Is this intended?

@yurivict The adios2-config is a script that is only used to help using ADIOS from a non CMAKE project, its generated after install and it also during its generation it builds a dummy project to test that it works. You do not need this if you intend to use ADIOS from a cmake project.

You can disable this component with: -DADIOS2_INSTALL_GENERATE_CONFIG=OFF

vicentebolea avatar Apr 21 '23 00:04 vicentebolea

Initial error might have been resolved in https://github.com/ornladios/ADIOS2/pull/3760

vicentebolea avatar Aug 23 '23 23:08 vicentebolea

Closing this since we cannot reproduce this error. Please re-open if you encounter this error again.

vicentebolea avatar Jul 19 '24 22:07 vicentebolea