Bug 266801 - graphics/lensfun: build fails
Summary: graphics/lensfun: build fails
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-03 19:26 UTC by Ivan Rozhuk
Modified: 2023-09-22 12:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments
patch (882 bytes, patch)
2023-05-02 02:23 UTC, Ivan Rozhuk
danfe: maintainer-approval-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2022-10-03 19:26:28 UTC
...
===>  Configuring for lensfun-0.3.95_2
===>  Performing out-of-source build
/bin/mkdir -p /tmp/ports/usr/ports/graphics/lensfun/work/.build
CMake Deprecation Warning at CMakeLists.txt:2 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- 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/libexec/ccache/cc - 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/libexec/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for include file endian.h
-- Looking for include file endian.h - not found
CMake Warning (dev) at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (GLIB2).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  cmake/modules/FindGLIB2.cmake:2 (INCLUDE)
  CMakeLists.txt:97 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PkgConfig: /usr/local/bin/pkgconf (found version "1.8.0") 
-- Checking for one of the modules 'glib-2.0'
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
-- Found PythonInterp: /usr/local/bin/python3.9 (found version "3.9.14") 
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.12") 
-- Found PNG: /usr/local/lib/libpng.so (found version "1.6.37+apng") 
-- -------------------------------------------------------------------------------------
-- Building Lensfun 0.3.95.0
-- -------------------------------------------------------------------------------------
-- Build as dynamic/shared library
-- Build type: Release
-- Build doc: OFF
-- Build test suite: ON
-- Build lenstool: ON
-- Build with support for SSE: ON
-- Build with support for SSE2: ON
-- Install helper scripts: OFF
-- 
Install prefix: /usr/local
-- 
Using: 
-- GLIB2 include dir: /usr/local/include/glib-2.0;/usr/local/lib/glib-2.0/include;/usr/local/include
-- GLIB2 library: glib-2.0;intl
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_FLAGS_DEBUG
    CMAKE_C_FLAGS_DEBUG
    CMAKE_C_FLAGS_RELEASE
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_VERBOSE_MAKEFILE
    THREADS_HAVE_PTHREAD_ARG


-- Build files have been written to: /tmp/ports/usr/ports/graphics/lensfun/work/.build
===>  Building for lensfun-0.3.95_2
[  1% 16/69] /usr/local/libexec/ccache/c++  -I/tmp/ports/usr/ports/graphics/lensfun/work/.build -I/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/include/lensfun -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -std=c++11 -Wall NOTFOUND NOTFOUND -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -MD -MT tests/CMakeFiles/test_database.dir/test_database.cpp.o -MF tests/CMakeFiles/test_database.dir/test_database.cpp.o.d -o tests/CMakeFiles/test_database.dir/test_database.cpp.o -c /tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/tests/test_database.cpp
FAILED: tests/CMakeFiles/test_database.dir/test_database.cpp.o 
/usr/local/libexec/ccache/c++  -I/tmp/ports/usr/ports/graphics/lensfun/work/.build -I/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/include/lensfun -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -std=c++11 -Wall NOTFOUND NOTFOUND -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -MD -MT tests/CMakeFiles/test_database.dir/test_database.cpp.o -MF tests/CMakeFiles/test_database.dir/test_database.cpp.o.d -o tests/CMakeFiles/test_database.dir/test_database.cpp.o -c /tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/tests/test_database.cpp
c++: error: no such file or directory: 'NOTFOUND'
c++: error: no such file or directory: 'NOTFOUND'
[  2% 16/69] /usr/local/libexec/ccache/c++  -I/tmp/ports/usr/ports/graphics/lensfun/work/.build -I/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/include/lensfun -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -std=c++11 -Wall NOTFOUND NOTFOUND -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -MD -MT tests/CMakeFiles/test_lens.dir/test_lens.cpp.o -MF tests/CMakeFiles/test_lens.dir/test_lens.cpp.o.d -o tests/CMakeFiles/test_lens.dir/test_lens.cpp.o -c /tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/tests/test_lens.cpp
FAILED: tests/CMakeFiles/test_lens.dir/test_lens.cpp.o 
/usr/local/libexec/ccache/c++  -I/tmp/ports/usr/ports/graphics/lensfun/work/.build -I/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/include/lensfun -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -std=c++11 -Wall NOTFOUND NOTFOUND -O2 -pipe -O3 -pipe -funroll-loops -mretpoline -fstack-protector-strong -fno-strict-aliasing -fdebug-prefix-map=/tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95=. -O3 -funroll-loops -mretpoline -MD -MT tests/CMakeFiles/test_lens.dir/test_lens.cpp.o -MF tests/CMakeFiles/test_lens.dir/test_lens.cpp.o.d -o tests/CMakeFiles/test_lens.dir/test_lens.cpp.o -c /tmp/ports/usr/ports/graphics/lensfun/work/lensfun-0.3.95/tests/test_lens.cpp
c++: error: no such file or directory: 'NOTFOUND'
c++: error: no such file or directory: 'NOTFOUND'
...
Comment 1 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-10-20 07:22:07 UTC
Interesting, I've never encountered this error.  Could it be caused by ccache, these lines:

-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 

or combination of both?
Comment 2 Ivan Rozhuk 2022-10-20 08:26:18 UTC
Is is not ccache, I  prefer to have minimal deps and OpenMP could be not installed in my system.
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-10-26 06:31:19 UTC
(In reply to Ivan Rozhuk from comment #2)
> I[t] is not ccache
Good to have it ruled out.

> I prefer to have minimal dep[endencies] and OpenMP could be not installed
> in my system.
Understood, albeit OpenMP should be natively supported by recent Clang and thus not pull any external dependency.  But okay, can you comment out all OpenMP-related lines in the tests/CMakeLists.txt and see if it helps?  Something like this:

post-patch:
	@${REINPLACE_CMD} -e '/OpenMP/d' ${WRKSRC}/tests/CMakeLists.txt
	...
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-10-27 04:14:09 UTC
Found an old upstream issue which looks related: https://github.com/lensfun/lensfun/issues/705, quote:

> Second, if OpenMP is not found, then ${OpenMP_CXX_FLAGS} will be the string
> "NOTFOUND" which leads to compile errors.
Comment 5 Ivan Rozhuk 2023-04-03 10:12:03 UTC
Same issue with audio/fluidsynth.

May be add some check for WITHOUT_OPENMP= in /etc/make.conf like done for GSSAPI?
Comment 6 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-04-03 10:43:22 UTC
(In reply to Ivan Rozhuk from comment #5)
> Same issue with audio/fluidsynth.
I still don't know how to reproduce it (without hacking system files to trigger the check) but for this particular port, you can disable OpenMP explicitly via "enable-openmp" option.

> Maybe add some check for WITHOUT_OPENMP= in /etc/make.conf like done for GSSAPI?
Sorry, I don't understand this phrase.  Meanwhile, you haven't answered my question in comment #3 whether patching OpenMP in tests/CMakeLists.txt helps.  I already forgot the details, but seem to vaguely recall OpenMP might not actually be used for those tests.
Comment 7 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-05-01 04:40:35 UTC
I wonder if ports b13bdddc8045 would change anything for you; if not, the question whether patching out OpenMP from `tests/CMakeLists.txt' still stands.
Comment 8 Ivan Rozhuk 2023-05-02 02:20:30 UTC
1. No, https://cgit.freebsd.org/ports/commit/?id=b13bdddc8045 does not help.
2. Yes, change from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266801#c3 work for me.
Comment 9 Ivan Rozhuk 2023-05-02 02:23:31 UTC
Created attachment 241920 [details]
patch
Comment 10 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-07-21 03:34:52 UTC
Comment on attachment 241920 [details]
patch

I've grepped the tests' source code and some of them actually use OpenMP (#ifdef _OPENMP), thus we should not blindly disable it.  So we're back to square one I'm afraid and still need to understand what's wrong with your system.  Do you have /usr/include/omp.h file?
Comment 11 Ivan Rozhuk 2023-09-22 12:52:02 UTC
(In reply to Alexey Dokuchaev from comment #10)

My system was build with:
WITHOUT_OPENMP=
in /etc/src.conf