Bug#1004218: /usr/lib/cmake/mathgl2/MathGLTargets.cmake: mgltask is missing when using cmake find_package(MathGL2)

Marius Mikucionis mmikucionis at gmail.com
Sat Jan 22 23:13:59 GMT 2022


Package: libmgl-dev
Version: 8.0.1-1
Severity: normal
File: /usr/lib/cmake/mathgl2/MathGLTargets.cmake

Dear maintainer,

I am trying to use libmgl-dev with the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.15)
project(GLPlotting)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(MathGL2 REQUIRED)


Then issue the following command:

mkdir -p build && cmake -B build -S .


It yields the following unexpected error message:

-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/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/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
CMake Error at /usr/lib/cmake/mathgl2/MathGLTargets.cmake:214 (message):
  The imported target "mgltask" references the file

     "/usr/bin/mgltask"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/cmake/mathgl2/MathGLTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/cmake/mathgl2/MathGL2Config.cmake:30 (include)
  CMakeLists.txt:7 (find_package)

-- Configuring incomplete, errors occurred!



I found that /usr/bin/mgltask is provided by mathgl package, thus libmgl-dev should depend on it, or the cmake script needs to be ammended not to look for it (I am not sure if/why these binaries are needed).

Also /usr/lib/cmake/mathgl2/MathGLTargets.cmake is looking for /usr/bin/udav, which is provided by udav, so libmgl-dev (or maybe libmgl-fltk8 or similar judging from the context) should have a dependency on udav package.

Then the same cmake script is looking for /usr/lib/cgi-bin/mgl.cgi whereas /usr/bin/mgl.cgi is provided by mathgl, so the path is wrong (maybe a symbolic link is needed? or parhaps mgl.cgi got installed in the wrong location?).

I am not planning on using CGI API, so ideally mgl.cgi should be optional (e.g. requested as an argument to find_package command).

Best regards,
Marius

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'stable-updates'), (500, 'stable'), (50, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-3-amd64 (SMP w/32 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:da:lt
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libmgl-dev depends on:
ii  libgl-dev     1.4.0-1
ii  libgsl-dev    2.7.1+dfsg-3
ii  libmgl-fltk8  8.0.1-1
ii  libmgl-glut8  8.0.1-1
ii  libmgl-mpi8   8.0.1-1
ii  libmgl-qt5-8  8.0.1-1
ii  libmgl-wnd8   8.0.1-1
ii  libmgl-wx8    8.0.1-1
ii  libmgl8       8.0.1-1
ii  libpng-dev    1.6.37-3

libmgl-dev recommends no packages.

libmgl-dev suggests no packages.

-- no debconf information



More information about the debian-science-maintainers mailing list