Skip to content

Commit c7ecc56

Browse files
committed
fix vcpkg
1 parent 855326c commit c7ecc56

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

data_structure/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0")
88
############ Dependencies
99

1010
find_package (Threads REQUIRED)
11-
#find_package(Boost)
1211
find_package(TBB CONFIG REQUIRED)
1312

1413
############## Default target to build
@@ -62,9 +61,12 @@ add_library( lactea_xp_merged ${LACTEAXP_MERGE_SRC_FILES}
6261
src/utils/portable_io.cpp
6362
)
6463
target_link_libraries(lactea_xp_merged
65-
TBB::tbb
6664
Threads::Threads
6765
)
66+
# Link TBB only on non-Windows systems
67+
if(NOT WIN32)
68+
target_link_libraries(lactea_xp_merged TBB::tbb)
69+
endif()
6870

6971
#### Star sorter XP MERGED
7072
add_executable( lactea_raw_star_db_sorter_xp_merged

data_structure/src/lactea_xp_merged/light_spectrum.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ const double* LightSpectrum::getHistogram() const { return _histogram; }
4343

4444
bool LightSpectrum::addFlux(const double b[], const double azero)
4545
{
46-
double a0 = std::max(azero, 0.);
46+
double a0 = fmax(azero, 0.);
4747
for (int i = 0; i < LIGHTSPECTRUM_NUM_BINS_BASE; ++i) {
48-
double f = std::max(b[i], 0.);
48+
double f = fmax(b[i], 0.);
4949
this->_histogram[i] += f;
5050
this->_histogram[LIGHTSPECTRUM_TOTAL_ENERGY_INDEX] += f;
5151
double corrected = f * pow(10, 0.4 * a0 * EXTINCTION_CURVE[i] / 3.1);
@@ -57,16 +57,16 @@ bool LightSpectrum::addFlux(const double b[], const double azero)
5757

5858
bool LightSpectrum::addPhotometry(double rp, double g, double bp)
5959
{
60-
this->_histogram[LIGHTSPECTRUM_RP_INDEX] += std::max(rp, 0.);
61-
this->_histogram[LIGHTSPECTRUM_G_INDEX] += std::max(g, 0.);
62-
this->_histogram[LIGHTSPECTRUM_BP_INDEX] += std::max(bp, 0.);
60+
this->_histogram[LIGHTSPECTRUM_RP_INDEX] += fmax(rp, 0.);
61+
this->_histogram[LIGHTSPECTRUM_G_INDEX] += fmax(g, 0.);
62+
this->_histogram[LIGHTSPECTRUM_BP_INDEX] += fmax(bp, 0.);
6363
return true;
6464
}
6565

6666

6767
bool LightSpectrum::addTemperature(double temperature)
6868
{
69-
this->_histogram[LIGHTSPECTRUM_TEMPERATURE_INDEX] += std::max(temperature, 0.);
69+
this->_histogram[LIGHTSPECTRUM_TEMPERATURE_INDEX] += fmax(temperature, 0.);
7070
this->_histogram[LIGHTSPECTRUM_TEMPERATURE_COUNT_INDEX] += temperature > 0;
7171
return true;
7272
}
@@ -76,22 +76,22 @@ LightSpectrum LightSpectrum::operator+(const LightSpectrum& b)
7676
{
7777
LightSpectrum ls;
7878
for (int i = 0; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
79-
ls._histogram[i] = std::max(this->_histogram[i] + b._histogram[i], 0.);
79+
ls._histogram[i] = fmax(this->_histogram[i] + b._histogram[i], 0.);
8080
return ls;
8181
}
8282

8383
LightSpectrum LightSpectrum::operator-(const LightSpectrum& b)
8484
{
8585
LightSpectrum ls;
8686
for (int i = 0; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
87-
ls._histogram[i] = std::max(0., this->_histogram[i] - b._histogram[i]);
87+
ls._histogram[i] = fmax(0., this->_histogram[i] - b._histogram[i]);
8888
return ls;
8989
}
9090

9191
LightSpectrum & LightSpectrum::operator+=(const LightSpectrum &b)
9292
{
9393
for (int i = 0; i < LIGHTSPECTRUM_NUM_BINS_TOTAL; ++i)
94-
this->_histogram[i] += std::max(b._histogram[i], 0.);
94+
this->_histogram[i] += fmax(b._histogram[i], 0.);
9595
return *this;
9696
}
9797

0 commit comments

Comments
 (0)