Skip to content

Commit 8e160bc

Browse files
committed
compiling on macos
1 parent ccb61fa commit 8e160bc

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

sf/CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ set(XLIBINCLUDE "/usr/X11/include/")
9898
set(XLIBLIBRARY "/usr/X11/lib/libX11.dylib")
9999
endif (APPLE)
100100

101-
target_link_libraries(sf
102-
PRIVATE
103-
asm
104-
vectorforth
105-
${TBB_LIBRARIES}
106-
${XLIBINCLUDE}
107-
)
101+
target_include_directories(sf
102+
PRIVATE
103+
${CMAKE_CURRENT_SOURCE_DIR}/../
104+
${CMAKE_CURRENT_SOURCE_DIR}/../jtk/
105+
${XLIBINCLUDE}
106+
${TBB_INCLUDE_DIR}
107+
)
108108

109109
target_link_libraries(sf
110110
PRIVATE
@@ -113,4 +113,4 @@ target_link_libraries(sf
113113
${XLIBLIBRARY}
114114
${TBB_LIBRARIES}
115115
)
116-
endif (UNIX)
116+
endif (UNIX)

shaderforth/image.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <emmintrin.h>
55
#include <stdint.h>
66
#include <memory>
7+
#include <cmath>
78

89
template <class T>
910
class image
@@ -309,4 +310,4 @@ void draw_line(T* raw, double x1, double y1, double x2, double y2, const uint32_
309310
error += dx;
310311
}
311312
}
312-
}
313+
}

vectorforth.tests/compile_tests.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,21 @@ namespace
110110
return *reinterpret_cast<int32_t*>(&f);
111111
}
112112

113+
union cvt256_to_64
114+
{
115+
__m256 v;
116+
uint64_t u[4];
117+
};
118+
113119
inline uint64_t get_avx2_u64(__m256 v, int i)
114120
{
115121
#ifdef _WIN32
116122
return *reinterpret_cast<uint64_t*>(&v.m256_f32[i]);
117-
#else
123+
#elif defined(unix)
118124
return *reinterpret_cast<uint64_t*>(&v[i]);
125+
#else
126+
cvt256_to_64 c = {v};
127+
return c.u[i];
119128
#endif
120129
}
121130

@@ -2922,4 +2931,4 @@ void run_all_compile_tests()
29222931
run_compile_tests(c_ops);
29232932
avx_mathfun_test();
29242933
avx_mathfun_test_2();
2925-
}
2934+
}

vectorforth.tests/test_assert.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <sstream>
44
#include <string>
5+
#include <cmath>
56

67
#define TEST_OUTPUT_LINE(...) \
78
{ printf(__VA_ARGS__); printf("\n"); }
@@ -69,4 +70,4 @@ void TestEqClose(T expval, U val, V tol, const char *file, int line, const char
6970
}
7071
else
7172
++testing_success;
72-
}
73+
}

0 commit comments

Comments
 (0)