You are not logged in.

#1 2024-08-22 17:11:04

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Building Almost Anything With Cmake and Make Suddenly Broken

I'm a chemist that's used Arch for a couple years now. In the process of setting up some computational chemistry toolkits, I've had multiple errors of the same nature come up when I try to build packages. Below is the output of attempting to build a computational chemistry package called Indigo, following the instructions provided in the package's README ( Indigo GitHub Repository for reference)

$ cmake .. -DBUILD_INDIGO=ON -DBUILD_INDIGO_WRAPPERS=ON -DBUILD_INDIGO_UTILS=ON

CMake Warning (dev) at CMakeLists.txt:5 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Enabling BUILD_INDIGO_WRAPPERS_PYTHON, BUILD_INDIGO_WRAPPERS_JAVA, BUILD_INDIGO_WRAPPERS_DOTNET because BUILD_INDIGO_WRAPPERS=ON
-- Enabling BUILD_BINGO_POSTGRES, BUILD_BINGO_SQLSERVER, BUILD_BINGO_ORACLE because BUILD_BINGO=ON
-- ENABLE_TESTS=ON
-- BUILD_STANDALONE=ON
-- BUILD_INDIGO=ON
-- BUILD_INDIGO_WRAPPERS=ON
-- BUILD_INDIGO_WRAPPERS_PYTHON=ON
-- BUILD_INDIGO_WRAPPERS_JAVA=ON
-- BUILD_INDIGO_WRAPPERS_DOTNET=ON
-- BUILD_INDIGO_UTILS=ON
-- BUILD_BINGO_POSTGRES=ON
-- BUILD_BINGO_SQLSERVER=ON
-- BUILD_BINGO_ORACLE=ON
-- BUILD_BINGO_ELASTIC=ON
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/usr/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/home/ryan/Indigo/build/CMakeFiles/CMakeScratch/TryCompile-K93UHc'
    
    Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_3a308/fast
    /usr/bin/make  -f CMakeFiles/cmTC_3a308.dir/build.make CMakeFiles/cmTC_3a308.dir/build
    make[1]: Entering directory '/home/ryan/Indigo/build/CMakeFiles/CMakeScratch/TryCompile-K93UHc'
    Building C object CMakeFiles/cmTC_3a308.dir/testCCompiler.c.o
    /usr/bin/gcc    -o CMakeFiles/cmTC_3a308.dir/testCCompiler.c.o -c /home/ryan/Indigo/build/CMakeFiles/CMakeScratch/TryCompile-K93UHc/testCCompiler.c
    Linking C executable cmTC_3a308
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3a308.dir/link.txt --verbose=1
    /usr/bin/gcc -Wl, -V  CMakeFiles/cmTC_3a308.dir/testCCompiler.c.o -o cmTC_3a308
    gcc: error: unrecognized command-line option ‘-V’
    make[1]: *** [CMakeFiles/cmTC_3a308.dir/build.make:99: cmTC_3a308] Error 1
    make[1]: Leaving directory '/home/ryan/Indigo/build/CMakeFiles/CMakeScratch/TryCompile-K93UHc'
    make: *** [Makefile:127: cmTC_3a308/fast] Error 2
    
  CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
  cmake/setup.cmake:13 (enable_language)
  CMakeLists.txt:113 (include)

I've searched everywhere for where the '-V' option could possibly be set, but I've had no luck in discovering where it could possibly be set. Anyone have any clue what's going on here?

Last edited by stuckinvim (2024-08-22 17:11:28)

Offline

#2 2024-08-22 17:19:50

cryptearth
Member
Registered: 2024-02-03
Posts: 2,015

Re: Building Almost Anything With Cmake and Make Suddenly Broken

have you installed the base-devel group?

Offline

#3 2024-08-22 17:26:42

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Re: Building Almost Anything With Cmake and Make Suddenly Broken

Yes, and all of the packages in the base-devel group are up to date

Offline

#4 2024-08-22 17:42:43

loqs
Member
Registered: 2014-03-06
Posts: 18,825

Re: Building Almost Anything With Cmake and Make Suddenly Broken

env --ignore-environment cmake .. -DBUILD_INDIGO=ON -DBUILD_INDIGO_WRAPPERS=ON -DBUILD_INDIGO_UTILS=ON

If the result is the same the option is being picked up from a config file.  If the above works the option is being picked up from the environment so check the output of `printenv`.

Offline

#5 2024-08-22 18:32:36

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Re: Building Almost Anything With Cmake and Make Suddenly Broken

Running

 env --ignore-environment cmake .. -DBUILD_INDIGO=ON -DBUILD_INDIGO_WRAPPERS=ON -DBUILD_INDIGO_UTILS=ON 

returns a cmake error "Could not find CMAKE_ROOT".

Running printenv gives this output:

SHELL=/bin/bash
SESSION_MANAGER=local/GU604:@/tmp/.ICE-unix/4317,unix/GU604:/tmp/.ICE-unix/4317
COLORTERM=truecolor
XDG_MENU_PREFIX=gnome-
CONDA_EXE=/home/ryan/miniconda3/bin/conda
_CE_M=
GNOME_KEYRING_CONTROL=/run/user/1000/keyring
LANGUAGE=en_US.UTF-8
MATHEMATICA_HOME=/usr/local/Wolfram/Mathematica/13.3
TERMINATOR_DBUS_PATH=/net/tenshu/Terminator2
QT_LOGGING_RULES=*=false
SSH_AUTH_SOCK=/run/user/1000/gcr/ssh
GRADLE_HOME=/usr/share/java/gradle
XDG_CONFIG_HOME=~/.config/i3
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
TERMINATOR_UUID=urn:uuid:058aebdc-64e2-43e6-9b28-7985dfb9088a
DESKTOP_SESSION=gnome
PWD=/home/ryan/Indigo/build
GSETTINGS_SCHEMA_DIR=/home/ryan/miniconda3/share/glib-2.0/schemas
LOGNAME=ryan
XDG_SESSION_DESKTOP=gnome
XDG_SESSION_TYPE=wayland
CONDA_PREFIX=/home/ryan/miniconda3
SYSTEMD_EXEC_PID=4508
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP=
CXX=/usr/bin/g++
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.RDJ1S2
MOTD_SHOWN=pam
GDM_LANG=en_US.UTF-8
GTK2_RC_FILES=/home/giganigga/.themes/win27pixmap/gtk-2.0/gtkrc
LDFLAGS=-Wl
HOME=/home/ryan
USERNAME=ryan
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=GNOME
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.SettingsDaemon.MediaKeys.service/memory.pressure
VTE_VERSION=7604
WAYLAND_DISPLAY=wayland-0
CONDA_PROMPT_MODIFIER=
INVOCATION_ID=d3d5ab2ebb7947e9bf5e5200a7099366
TERMINATOR_DBUS_NAME=net.tenshu.Terminator25ef4b219e3b005583550f2b0f9f990c3
MANAGERPID=4156
GNOME_SETUP_DISPLAY=:1
XDG_SESSION_CLASS=user
ANDROID_HOME=/opt/android-sdk
TERM=xterm-256color
_CE_CONDA=
USER=ryan
CONDA_SHLVL=1
DISPLAY=:0
SHLVL=1
CONDA_PYTHON_EXE=/home/ryan/miniconda3/bin/python
XDG_RUNTIME_DIR=/run/user/1000
CONDA_DEFAULT_ENV=base
DEBUGINFOD_URLS=https://debuginfod.archlinux.org 
LC_ALL=en_US.UTF-8
JOURNAL_STREAM=9:1899
XDG_DATA_DIRS=/home/ryan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
PATH=/home/ryan/miniconda3/bin:/home/ryan/miniconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin
CC=/usr/bin/gcc
GDMSESSION=gnome
CMAKE_ROOT=/usr/share/cmake
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/ryan
GIO_LAUNCHED_DESKTOP_FILE_PID=11517
OLDPWD=/home/ryan/Indigo
_=/usr/bin/printenv

Offline

#6 2024-08-22 19:04:03

loqs
Member
Registered: 2014-03-06
Posts: 18,825

Re: Building Almost Anything With Cmake and Make Suddenly Broken

What if you unset `LDFLAGS=-Wl` the `,option` part of the option to pass to the linker is missing.

Offline

#7 2024-08-22 19:39:06

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Re: Building Almost Anything With Cmake and Make Suddenly Broken

For some reason it seems to still be passing the -Wl and -V options to the compiler despite having unset the $LDFLAGS variable according to these lines in the cmake output

 /usr/bin/gcc -Wl, -V  CMakeFiles/cmTC_32003.dir/testCCompiler.c.o -o cmTC_32003
 gcc: error: unrecognized command-line option ‘-V’

Offline

#8 2024-08-22 19:47:01

loqs
Member
Registered: 2014-03-06
Posts: 18,825

Re: Building Almost Anything With Cmake and Make Suddenly Broken

If you put the following a new directory then run make from within that directory does that work?
Makefile

a: a.o

a.c

int main () {
  return 0;
}

Offline

#9 2024-08-22 21:42:53

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,849

Re: Building Almost Anything With Cmake and Make Suddenly Broken

PATH=/home/ryan/miniconda3/bin:/home/ryan/miniconda3/condabin:/usr/local/bin:/usr/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin:/home/ryan/.cargo/bin:/home/ryan/.local/lib/python3.10/site-packages:/home/ryan/.local/bin:/opt/anaconda/bin

How about exiting/stopping the conda session and then try again ?

See https://wiki.archlinux.org/title/Conda for info how to use conda without it screwing up your system functionality .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#10 2024-08-23 14:18:50

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Re: Building Almost Anything With Cmake and Make Suddenly Broken

Yeah Conda was definitely causing problems, since running a simple test with loqs' provided Makefile appears to work now that I've stopped the Conda environment and edited my path. For some reason, though, even though I don't have a CFLAGS, CXX or LDFLAGS, cmake is still throwing the "Unrecognized command line option: '-V'" as if I have something passing that option to GCC/G++ still. I've looked everywhere I can think of and haven't had any luck finding what could possibly be causing this...

Offline

#11 2024-08-24 09:22:27

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,849

Re: Building Almost Anything With Cmake and Make Suddenly Broken

Create a fresh testuser, login as that user to tty/console and stay on tty.

create a build folder and try to build the indigo sw you mentioned in #1.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#12 2024-08-24 17:25:15

stuckinvim
Member
Registered: 2024-08-22
Posts: 9

Re: Building Almost Anything With Cmake and Make Suddenly Broken

Running the build under a test user in another TTY worked perfectly, so I suppose that isolates it to being an issue with my user and not the global environment configuration

Offline

Board footer

Powered by FluxBB