Memo for setting up the frontend and backend
Mac Big Sur install homebrew https://stackoverflow.com/questions/64882584/how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook
Ming-yi's note for Mac:
directly type emcc
if you include git clone --recursive https:...
It will download the submodule simutaneously, then you can skip to type
cd protobuf
git submodule init
: setting "ready to update submodule". So far, the submodule directories are empty.
git submodule update
:letting submodule update
git checkout master
:# using git checkout dev when using the dev branch of carta-frontend
Final step to open the frontend window: npm start
git pull
in protobuf, you need to ./build_proto.sh
builds the static JavaScript code, as well as the TypeScript definitions, and symlinks to the node_modules/carta-protobuf directory.
- Going to the 'target' github webpage and copy the link (https:....)
sudo git clone https:....
under /usr/local/src- cd 'target' folder
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/'target'/
產生編譯的檔案 並且指定安裝到/usr/local/'target'/
如果沒有指明 (-DCMAKE_INSTALL_PREFIX=/usr/local/'target'/
) 他就會安裝在usr/local/lib/
裡面 名稱會是:libXXX- 在
/usr/local/src/build/
下面typemake
這個步驟是在編譯,並且放置在build裡面 - 在
/usr/local/src/build/
下面typemake intall
這個步驟才會把source code完整安裝到/usr/local/'target'/
- uWebSockets
沒有cmake只有Makefile時,直接type
make
make install
- tbb
git clone https://github.com/wjakob/tbb.git
cd tbb/build
cmake ..
make -j
sudo make install
make check
sudo make install
works fine with my Mac. No errors with
make check
=
- casacore
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/casacore
-DUSE_FFTW3=ON
-DUSE_HDF5=ON
-DUSE_THREADS=ON
-DUSE_OPENMP=ON
-DCMAKE_BUILD_TYPE=Release
-DBUILD_TESTING=OFF
-DBoost_NO_BOOST_CMAKE=1
-DBUILD_PYTHON=OFF
-DDATA_DIR=/usr/share/casacore/data
- casacore (2019/12/10 casacore6)
https://open-bitbucket.nrao.edu/projects/CASA/repos/carta-casacore/browse
cmake -DUseCcache=1 -DHAS_CXX11=1 -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran -DBoost_NO_BOOST_CMAKE=1 -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_FLAGS="-I /Library/Python/2.7/site-packages/numpy/core/include" -DCMAKE_BUILD_TYPE=Debug ..
- carta-protobuf
-I means include
-L means lib
$cmake -DCMAKE_CXX_FLAGS="-I /usr/local/casacore/include
-I /usr/local/fmt/include
-I /usr/local/Cellar/tbb/2019_U8/include
-I /usr/local/include
-I /usr/local/Cellar/openssl/1.0.2s/include
-I /usr/local/zfp/include"
-DCMAKE_CXX_STANDARD_LIBRARIES="-L /usr/local/casacore/lib
-L /usr/local/lib
-L /usr/local/Cellar/openssl/1.0.2s/lib
-L /usr/local/fmt/lib
-L /usr/local/zfp/lib -luWS" ..
$make
如果要跟新 要在build下面
$git pull
($cmake xxx)
$make
Final step to open the backend server:
$LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/casacore/lib
$export LD_LIBRARY_PATH
$./carta_backend
casacore installation
Once it has been installed(/usr/local/), the carta-backend should re-build again. So far it works on Ubuntu system:
Final step to open the backend server:
$LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/casacore/lib:/usr/local/zfp/lib:/usr/local/lib
$export LD_LIBRARY_PATH
$./carta_backend
Problem:
sudo echo 'code/*' > .git/info/sparse-checkout
terminal returns Permission denied!
Solution
>>
happens before the actual command execution and does not run with the elevated sudo
privileges.
An alternative way to do this, is to wrap the entire command in another bash command shell:
sudo bash -c "echo 'code/*' > .git/info/sparse-checkout"
Problem:
- make: cannot find fmt
solution:
sudo apt-get install libfmt-dev
(not libfmt3-dev for Ubutntu 18)
- final cmake version:
$ cmake .. -DCMAKE_CXX_FLAGS="-I/usr/local/include/casacode -I/usr/local/include/casacore -I/usr/local/casacore/include -I/usr/local/casacore/include/casacore/ -I/usr/local/zfp/include/" -DCMAKE_CXX_STANDARD_LIBRARIES="-L/usr/local/lib -L/usr/local/casacore/lib -L/usr/local/zfp/lib -L/usr/local/protobuf/lib -limageanalysis"
$ make
Problem:
[100%] Linking CXX executable carta_backend
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libuWS.so: undefined reference to `SSLv23_client_method'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libuWS.so: undefined reference to `SSL_library_init'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libuWS.so: undefined reference to `SSLv23_server_method'
collect2: error: ld returned 1 exit status
CMakeFiles/carta_backend.dir/build.make:787: recipe for target 'carta_backend' failed
make[2]: *** [carta_backend] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/carta_backend.dir/all' failed
make[1]: *** [CMakeFiles/carta_backend.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Solution:
apt install libssl1.0-dev
Problem: The backend can not find the “data” directory containing the “ephemerides” and “geodetic” data.
mkdir -p /usr/share/casacore/data/ephemerides
mkdir -p /usr/share/casacore/data/geodetic
svn co https://svn.cv.nrao.edu/svn/casa-data/distro/ephemerides/ /usr/share/casacore/data/ephemerides
svn co https://svn.cv.nrao.edu/svn/casa-data/distro/geodetic/ /usr/share/casacore/data/geodetic
or follow the NRAO construction: https://casa.nrao.edu/casadocs/casa-6.1.0/external-data/casa-data-repository
Problem:
2021-03-12 03:06:34 WARN MeasIERS::findTab (file /build/carta-casacore-GjcRTt/carta-casacore-2020.8.20~focal/casa6/casatools/casacore/measures/Measures/MeasIERS.cc, line 387) Requested data table Observatories cannot be found in the searched directories:
2021-03-12 03:06:34 WARN MeasIERS::findTab (file /build/carta-casacore-GjcRTt/carta-casacore-2020.8.20~focal/casa6/casatools/casacore/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/ephemerides/
2021-03-12 03:06:34 WARN MeasIERS::findTab (file /build/carta-casacore-GjcRTt/carta-casacore-2020.8.20~focal/casa6/casatools/casacore/measures/Measures/MeasIERS.cc, line 387)+ /usr/share/casacore/data/geodetic/
2021-03-12 03:06:34 SEVERE MeasTable::doInitObservatories() (file /build/carta-casacore-GjcRTt/carta-casacore-2020.8.20~focal/casa6/casatools/casacore/measures/Measures/MeasTable.cc, line 2865) Cannot read table of Observatories
Solution:
apt-add-repository -y -s ppa:kernsuite/kern-7
apt-get update
apt-get -y install casacore-data
install packages: nlohmann-json3-dev
install packages: wcslib-dev, libcfitsio-dev
frontend should have: the frontend folder should contain "build" folder
npm run build-docker
(if no docker should try: npm run build
)
backend command should contain --frontend_folder
./carta_backend /home/mingyi/carta-test-img --omp_threads=4 --verbosity=5 --log_performance=true --frontend_folder=/home/mingyi/carta-frontend/build
then the backend will automatically generate token and open url with the token
or you assign a token to the backend
if you assign token=0000
CARTA_AUTH_TOKEN=000 ./carta_backend /home/mingyi/carta-test-img --omp_threads=4 --verbosity=5 --log_performance=true --frontend_folder=/home/mingyi/carta-frontend/build
https://zwarrior.medium.com/install-google-test-framework-gtest-on-ubuntu-20-04-368eb6951b12
https://docs.google.com/document/d/1zZgsb9PIvzPs35_PuIe0TYXV6Lc9vtMPK-DjxJ7SP0I/edit