Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion compile_withcmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,31 @@ cd ..

# compile mmwis:
cd mmwis
./compile.sh

# Use Homebrew g++ on macOS, system g++ on Linux
if [[ "$unamestr" == "Darwin" ]]; then
# Try to find Homebrew g++ (g++-15, g++-14, g++-13, etc.)
GPP=""
GCC=""
BREW_PREFIX=$(brew --prefix 2>/dev/null || echo "/usr/local")
for version in 15 14 13 12 11; do
if [ -f "$BREW_PREFIX/bin/g++-$version" ]; then
GPP="$BREW_PREFIX/bin/g++-$version"
GCC="$BREW_PREFIX/bin/gcc-$version"
echo "Using compiler: $GPP"
break
fi
done
if [ -z "$GPP" ]; then
echo "Warning: Homebrew g++ not found, using system compiler (may fail)"
GPP=$(which g++)
GCC=$(which gcc)
fi
cmake ../ -DCMAKE_C_COMPILER="$GCC" -DCMAKE_CXX_COMPILER="$GPP"
else
cmake ../
fi

cd ..

mkdir deploy
Expand Down
2 changes: 1 addition & 1 deletion mmwis/app/mmwis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int run(mmwis::MISConfig &mis_config, graph_access &G, NodeWeight weight_offset)
evo.perform_mis_search(mis_config, G, independent_set, best_nodes, worse_nodes, solved_exactly, false);
mmwis::mmwis_log::instance()->print_results();
if (mis_config.print_log) mmwis::mmwis_log::instance()->write_log();
/* if (mis_config.write_graph) graph_io::writeIndependentSet(G, mis_config.output_filename); */
if (mis_config.write_graph) graph_io::writeIndependentSet(G, mis_config.output_filename);
#ifdef NDEBUG
if(is_IS(G)) {
int solution_weight = weight_offset;
Expand Down
26 changes: 25 additions & 1 deletion mmwis/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,31 @@ rm -rf deploy
rm -rf build
mkdir build
cd build
cmake ../ -DCMAKE_C_COMPILER=$(which gcc) -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_BUILD_TYPE=${buildtype}

# Use Homebrew g++ on macOS, system g++ on Linux
if [[ "$unamestr" == "Darwin" ]]; then
# Try to find Homebrew g++ (g++-15, g++-14, g++-13, etc.)
GPP=""
GCC=""
BREW_PREFIX=$(brew --prefix 2>/dev/null || echo "/usr/local")
for version in 15 14 13 12 11; do
if [ -f "$BREW_PREFIX/bin/g++-$version" ]; then
GPP="$BREW_PREFIX/bin/g++-$version"
GCC="$BREW_PREFIX/bin/gcc-$version"
echo "Using compiler: $GPP"
break
fi
done
if [ -z "$GPP" ]; then
echo "Warning: Homebrew g++ not found, using system compiler (may fail)"
GPP=$(which g++)
GCC=$(which gcc)
fi
cmake ../ -DCMAKE_C_COMPILER="$GCC" -DCMAKE_CXX_COMPILER="$GPP" -DCMAKE_BUILD_TYPE=${buildtype}
else
cmake ../ -DCMAKE_C_COMPILER=$(which gcc) -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_BUILD_TYPE=${buildtype}
fi

make -j $NCORES
cd ..

Expand Down
2 changes: 1 addition & 1 deletion wmis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.9)
cmake_minimum_required(VERSION 3.5)
project(components)

if (NOT CMAKE_BUILD_TYPE)
Expand Down