Skip to content

Fix build crash on Clang by isolating lp_solve C flags#441

Open
Mohit-Lakra wants to merge 1 commit intoGeomScale:developfrom
Mohit-Lakra:Fix_LP_Solve_error
Open

Fix build crash on Clang by isolating lp_solve C flags#441
Mohit-Lakra wants to merge 1 commit intoGeomScale:developfrom
Mohit-Lakra:Fix_LP_Solve_error

Conversation

@Mohit-Lakra
Copy link
Contributor

@Mohit-Lakra Mohit-Lakra commented Jan 30, 2026

I ran into a build failure while trying to run some of the volume examples on my machine using Clang. It turns out that lp_solve (which is pure C) was accidentally trying to use the project-wide C++17 flags. Clang is pretty strict about this and throws an error because -std=c++17 isn't valid for C files.

I’ve updated LPSolve.cmake to make sure the lp_solve target is strictly treated as C.

What I changed:

Forced the LINKER_LANGUAGE to C for the lp_solve target.

Set the C_STANDARD to 99 so it doesn't try to inherit the C++ standard.

Added a generator expression to the compile options so that -std=c99 is only applied to C files. This effectively "shields" the dependency from any C++ flag leakage.

This should make the build process much smoother for anyone working on macOS or using newer versions of Clang.

Fixes: #440

Before :
image

After :
Screenshot 2026-01-30 at 11 33 59 PM

@Mohit-Lakra
Copy link
Contributor Author

Hi @vissarion , I've implemented a fix for the build crash we were seeing on Clang. It specifically isolates the lp_solve C dependency so it doesn't try to use the project's C++17 flags. I verified the fix by building the hpolytopeVolume example, and it's working smoothly now. Please review it whenever you have time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building examples fails: lp_solve won't compile because of C++17 flags

1 participant