Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,808
    • Issues 3,808
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #16769

Closed
Open
Created Apr 02, 2017 by Marc Glisse@mglisse

sunCC on debian

Hello,

I am using oracle developer studio 12.6 beta on a debian testing x86_64 system. I added cc.defaults and CC.defaults files in $studio/lib/compilers/etc/config which contain -Wp,-I/usr/include/x86_64-linux-gnu, and the compiler seems to work on a few simple tests (in particular it can find headers in /usr/include/x86_64-linux-gnu when I compile without any specific flags, suncc -c test.c). cmake does identify the compiler as SunPro 5.15.0. However, cmake fails to search for headers in that directory (it searches in many places that do not exist like /usr/include/w32api, /usr/pkg/include, /opt/csw/include, /usr/openwin/include, etc).

I tested with a 1-line CMakeLists.txt: find_path(FOO gmp.h) and then, from different subdirectories, compared CC=gcc cmake .. and CC=suncc cmake .., and gmp.h was only found in the first case.

I tried using

list(APPEND CMAKE_SYSTEM_INCLUDE_PATH /usr/include/x86_64-linux-gnu)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/x86_64-linux-gnu)

but that is not just used for searching files, cmake also passes corresponding -I and -L flags to the compiler, which breaks things (the order in which system paths are searched is very sensitive).

I believe that cmake should know that on debian, whatever the compiler, those 2 paths exist and contain important stuff... (the compiler is still relevant in that it determines the target, and thus which triplet to append to /usr/{include,lib})

An alternative would be to stop looking for files all over the place, trying to duplicate compiler logic, and rely on something like try_compile (like autoconf).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking