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 build issue on Fedora 38: Could NOT find PROJ (missing: PROJINC) #41

Closed
neteler opened this issue Feb 5, 2024 · 3 comments · Fixed by #42
Closed

cmake build issue on Fedora 38: Could NOT find PROJ (missing: PROJINC) #41

neteler opened this issue Feb 5, 2024 · 3 comments · Fixed by #42
Labels
bug Something isn't working

Comments

@neteler
Copy link
Member

neteler commented Feb 5, 2024

I have tried to compile the current driver version on my Fedora 38 box:

cmake .. -DAUTOLOAD_DIR=/usr/lib64/gdalplugin \
        -DGDAL_CONFIG_PREFER_PATH=/usr/bin/   -DGRASS_BIN_PREFER_PATH=$HOME/bin/
-- Found GDAL: /usr/lib64/libgdal.so (3.6.4)
-- Found GRASS_GISBASE: /home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu (8.3.2dev)
-- Could NOT find PROJ (missing: PROJINC) 
-- Using /usr/lib64/gdalplugin as GDAL shared library autoload directory
-- Configuring done (0.5s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    GDAL_CONFIG_PREFER_PATH

-- Build files have been written to: /home/mneteler/software/gdal-grass/build

Since I can successfully compile GRASS GIS on the same machine (start script in $HOME/bin/) I am a bit lost...

cd ~/software/gdal-grass
ag PROJINC
CMakeLists.txt
57:                     ${GRASS_INCLUDE} ${PROJINC})
66:                    ${GRASS_INCLUDE} ${PROJINC})

cmake/FindPROJ.cmake
10:set(PROJINC "")
12:get_grass_platform_var("${GRASS_GISBASE}/include/Make/Platform.make" "PROJINC"
13:                       PROJINC)
15:if(NOT "${PROJINC}" STREQUAL "")
16:  string(REGEX REPLACE "-I(.*)" "\\1" PROJINC "${PROJINC}")
20:find_package_handle_standard_args(PROJ REQUIRED_VARS PROJINC)

... seems to fail on my system.

Here my setup:

which grass 
~/bin/grass

grass --config
x86_64-pc-linux-gnu
./configure --with-cxx --enable-largefile --with-proj-share=/usr/share/proj --with-gdal=/usr/bin/gdal-config --with-geos --with-sqlite --with-nls --with-zstd --with-pdal --with-cairo --with-cairo-ldflags=-lfontconfig --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-fftw --with-postgres --with-postgres-includes=/usr/include/pgsql --with-blas --with-blas-includes=/usr/include/atlas-x86_64-base/ --with-lapack --with-lapack-includes=/usr/include/atlas-x86_64-base/ --with-openmp --with-netcdf --without-bzlib --without-mysql --without-odbc CFLAGS=-g -Wall -Wstringop-truncation -Wshadow -Wlogical-op -Werror-implicit-function-declaration -fPIC -fno-common -fno-omit-frame-pointer -fexceptions -Wextra -Wunused -Wreturn-type -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector -m64 -fdiagnostics-color LDFLAGS=-Wl,--no-undefined -Wl,-z,now CXXFLAGS=-g -Wall
gcc
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu
/home/mneteler/software/grass83/dist.x86_64-pc-linux-gnu/etc/python
08018e34b2
8.3.2dev
2023-10-25T07:54:00+00:00

Ideas welcome :-)

@neteler neteler added the bug Something isn't working label Feb 5, 2024
@nilason
Copy link
Collaborator

nilason commented Feb 5, 2024

The cmake code is looking at ${GRASS_GISBASE}/include/Make/Platform.make for the variable PROJINC. If this is not set there (Platform.make) this cmake code need to be improved to take that into account.

@neteler
Copy link
Member Author

neteler commented Feb 5, 2024

Checking on my Fedora box:

grep PROJINC include/Make/*
include/Make/Platform.make:PROJINC             = 
include/Make/Platform.make.in:PROJINC             = @PROJINC@

Still GRASS GIS compiles fine as the PROJ inc files are in standard directories:

rpm -qil proj-devel
Name        : proj-devel
Version     : 9.1.1
Release     : 1.fc38
Architecture: x86_64
Install Date: Sun 03 Dec 2023 05:43:31 PM CET
Group       : Unspecified
Size        : 542847
License     : MIT
Signature   : RSA/SHA256, Fri 02 Dec 2022 04:56:46 PM CET, Key ID 809a8d7ceb10b464
Source RPM  : proj-9.1.1-1.fc38.src.rpm
Build Date  : Fri 02 Dec 2022 04:36:46 PM CET
Build Host  : buildhw-x86-14.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://proj.org
Bug URL     : https://bugz.fedoraproject.org/proj
Summary     : Development files for PROJ
Description :
This package contains libproj and the appropriate header files and man pages.
/usr/include/geodesic.h
/usr/include/proj
/usr/include/proj.h
/usr/include/proj/common.hpp
/usr/include/proj/coordinateoperation.hpp
/usr/include/proj/coordinatesystem.hpp
/usr/include/proj/crs.hpp
/usr/include/proj/datum.hpp
/usr/include/proj/io.hpp
/usr/include/proj/metadata.hpp
/usr/include/proj/nn.hpp
/usr/include/proj/util.hpp
/usr/include/proj_constants.h
/usr/include/proj_experimental.h
/usr/include/proj_symbol_rename.h
/usr/lib64/cmake/proj
/usr/lib64/cmake/proj/proj-config-version.cmake
/usr/lib64/cmake/proj/proj-config.cmake
/usr/lib64/cmake/proj/proj-targets-release.cmake
/usr/lib64/cmake/proj/proj-targets.cmake
/usr/lib64/cmake/proj/proj4-targets-release.cmake
/usr/lib64/cmake/proj/proj4-targets.cmake
/usr/lib64/cmake/proj4
/usr/lib64/cmake/proj4/proj-targets-release.cmake
/usr/lib64/cmake/proj4/proj-targets.cmake
/usr/lib64/cmake/proj4/proj4-config-version.cmake
/usr/lib64/cmake/proj4/proj4-config.cmake
/usr/lib64/cmake/proj4/proj4-targets-release.cmake
/usr/lib64/cmake/proj4/proj4-targets.cmake
/usr/lib64/libproj.so
/usr/lib64/pkgconfig/proj.pc

@nilason
Copy link
Collaborator

nilason commented Feb 6, 2024

@neteler Please try out #42, it is supposed to work without any configure parameters.

cmake .. is all that should be needed. (Eventually with the exception of AUTOLOAD_DIR for testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants