Skip to content

Commit 9d67379

Browse files
aporialiaofacebook-github-bot
authored andcommitted
Allow undefined libraries to fix CMake errors (#2849)
Summary: This should get rid of the `libtorch_cpu.so: undefined reference to `logf@GLIBC_2.27'` etc.. we see in our cpp unit tests on Github CI See: https://fb.workplace.com/groups/1405155842844877/permalink/23944202491846891/ Note there is another error of undefined reference with specific benchmark library - this will need a different fix. coming in next diff Differential Revision: D71862824
1 parent 7652c5d commit 9d67379

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/cpp_unittest_ci_cpu.yml

+25
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,30 @@ jobs:
4747
conda create -y --name build_binary python=${{ matrix.python-version }}
4848
conda info
4949
python --version
50+
conda run -n build_binary python --version
51+
conda run -n build_binary \
52+
pip install torch --index-url https://download.pytorch.org/whl/nightly/cpu
53+
conda run -n build_binary \
54+
python -c "import torch"
55+
echo "torch succeeded"
56+
conda run -n build_binary \
57+
python -c "import torch.distributed"
58+
conda run -n build_binary \
59+
pip install fbgemm-gpu --index-url https://download.pytorch.org/whl/nightly/cpu
60+
conda run -n build_binary \
61+
python -c "import fbgemm_gpu"
62+
echo "fbgemm_gpu succeeded"
63+
conda run -n build_binary \
64+
pip install -r requirements.txt
65+
conda run -n build_binary \
66+
python setup.py bdist_wheel \
67+
--python-tag=${{ matrix.python-tag }}
68+
conda run -n build_binary \
69+
python -c "import torchrec"
70+
echo "torch.distributed succeeded"
71+
conda run -n build_binary \
72+
python -c "import numpy"
73+
echo "numpy succeeded"
5074
echo "Starting C++ Tests"
5175
conda install -n build_binary -y gxx_linux-64
5276
conda run -n build_binary \
@@ -58,6 +82,7 @@ jobs:
5882
conda run -n build_binary cmake \
5983
-DBUILD_TEST=ON \
6084
-DBUILD_REDIS_IO=ON \
85+
-DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
6186
-DCMAKE_PREFIX_PATH=/opt/conda/envs/build_binary/lib/python${{ matrix.python-version }}/site-packages/torch/share/cmake ..
6287
conda run -n build_binary make -j
6388
conda run -n build_binary ctest -V .

0 commit comments

Comments
 (0)