master
:
mainstream branch, no development.
develop
:
development branch, usually will merge feature branch to it and include hot fix for those feature. After each phase release, merge develop
to master
.
each feature branch
:
people develop each feature in its branch whose name can be peter/drawImage
or issue-131
if we use tickets. When it is finished, use pull request
to proceed code review and then merge to develop. After merging, evaluate those added features on develop
.
Fix Bug
:
Except some special cases, such as modifying documents, changing build scripts, low/no-risk fixes, otherwise you need to commit your bug fixes in Hotfix branch or the original feature branch, then make a pull request to do code review.
Development platform:
Supported deployment platform:
Tested c++ compiler: gcc 4.8.5, 5.4 (used by Ubuntu 16.04) & clang on macOS.
CARTA can be built by Qt 5.3, 5.4, 5.5, 5.6~5.8. Start from 5.6, we need to install QtWebKit & QtWebKit additionally.
Follow https://github.com/CARTAvis/carta/wiki#build-carta.
Need to prepare some things needed for running CARTA and also appended parameters.
cd your-carta-work
,, execute ./CARTAvis/carta/scripts/setupcartavis.sh
.
It is optional. You do not need to setup this and can use CARTA smoothly. But not sure if snaptshot
function of CARTA will work OK without setup this.
There are two things you need to know first.
The folder structure and why you need to choose a your-carta-work
, take a look here, https://github.com/CARTAvis/carta/wiki/build#step2---choose-your-working-space-folder-of-carta-and-clone-source-code-of-carta.
Due to the history issue, so you should rename this git project folder from carta
to CARTAvis
. Therefore you can executee git clone https://github.com/CARTAvis/carta.git CARTAvis
.
Paste the following content to your terminal to install.
mkdir data ; \
mkdir data/ephemerides ;\
mkdir data/geodetic ; \
svn co https://svn.cv.nrao.edu/svn/casa-data/distro/ephemerides/ data/ephemerides ;\
svn co https://svn.cv.nrao.edu/svn/casa-data/distro/geodetic/ data/geodetic ; \
mv data ~/
The default location is under home directory ~/
, and will be improved to better place.
The default loading path is ~/CARTA/Images
and you can put there or other places (you need to switch the folder in the file browser of CARTA).
You can also chooose fits file in this git project folder, your-carta-work/CARTAvis/carta/scriptedClient/tests/data
when using file browser of CARTA. The other ways to get testing fits files,
The default location is $(HOME)/CARTA/cache/pcache.sqlite
so create $(HOME)/CARTA/cache
if it does not exist.
Create/Modify the following data to be the content of ~/.cartavis/config.json
{
"_comment" : "List of plugin directories",
"pluginDirs": [
"$(APPDIR)/../plugins",
"$(APPDIR)/../../../../plugins"
],
"disabledPlugins" : ["tester1", "clock1", "blurpy"],
"plugins": {
"PCacheSqlite3" : {
"dbPath": "$(HOME)/CARTA/cache/pcache.sqlite"
}
}
}
$(APPDIR)/../plugins
is for Linux. "$(APPDIR)/../../../../plugins"
is for Mac.
You can browse more detailed instruction about these parameters from here, http://cartaserver.ddns.net/docs/html/developer/contribute/Writinganimageplugin.html#appendix-e-carta-config-file
Current CARTA needs to execute the following command every time to find correct dynamic/shared Library before running CARTA. Will improve later by using rpath
.
## 1-1 for casa libs
## on Linux, use this
export LD_LIBRARY_PATH=$CARTAWORKHOME/CARTAvis-externals/ThirdParty/casa/trunk/linux/lib:${LD_LIBRARY_PATH}
## on Mac, use this
export LD_LIBRARY_PATH=$CARTAWORKHOME/CARTAvis-externals/ThirdParty/casa/trunk/darwin/lib:${LD_LIBRARY_PATH}
## or this path, should work but not test. It is the symbolic link of the above path,
## export LD_LIBRARY_PATH=$CARTAWORKHOME/CARTAvis-externals/ThirdParty/casacore/lib:${LD_LIBRARY_PATH}
## 1-2 for wcslib, only Mac. no need to setup the path wcslib on Linux, we already use QMAKE_RPATHDIR which seems not work on Mac.
export LD_LIBRARY_PATH=$CARTAWORKHOME/CARTAvis-externals/ThirdParty/wcslib/lib:${LD_LIBRARY_PATH}
## 1-3 for /usr/local/lib/libgsl.dylib which is needed by Fitter1D plugin
export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
On Mac, you can use Qt Creator build without setting 1-1, 1-3 thing by (LD_LIBRARY_PATH). In Qt Creator, there is a default enabled setting which will automatically add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEWORK_PATH (Mac, work), add build library search path to LD_LIBRARY_PATH (Linux, not work, don't know why).
On Mac, you need to setup below thing, you can copy them as a shell script. [Caution: the below script is setup when build folder is choosed in CARTAvis]
cd $CARTAWORKHOME/CARTAvis
export CARTABUILDHOME=`pwd`
mkdir -p $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/ cp $CARTABUILDHOME/build/cpp/core/libcore.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/
rm $CARTABUILDHOME/build/cpp/core/libcore.1.dylib cp $CARTABUILDHOME/build/cpp/CartaLib/libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/
install_name_tool -change qwt.framework/Versions/6/qwt $CARTABUILDHOME/ThirdParty/qwt-6.1.2/lib/qwt.framework/Versions/6/qwt $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/MacOS/CARTA install_name_tool -change qwt.framework/Versions/6/qwt $CARTABUILDHOME/ThirdParty/qwt-6.1.2/lib/qwt.framework/Versions/6/qwt $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libcore.1.dylib
install_name_tool -change libcore.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libcore.1.dylib $CARTABUILDHOME/build/cpp/plugins/ImageStatistics/libplugin.dylib
install_name_tool -change libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/plugins/ImageStatistics/libplugin.dylib install_name_tool -change libcore.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libcore.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/MacOS/CARTA install_name_tool -change libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/MacOS/CARTA install_name_tool -change libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libcore.1.dylib
for f in find . -name libplugin.dylib
; do install_name_tool -change libcore.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libcore.1.dylib $f; done
for f in find . -name libplugin.dylib
; do install_name_tool -change libCartaLib.1.dylib $CARTABUILDHOME/build/cpp/desktop/CARTA.app/Contents/Frameworks/libCartaLib.1.dylib $f; done
for f in find . -name "*.dylib"
; do install_name_tool -change libwcs.5.15.dylib $CARTABUILDHOME/ThirdParty/wcslib/lib/libwcs.5.15.dylib $f; echo $f; done
execute ulimit -n 2000
before running CARTA
To run CARTA
binary with parameters, at least should append html file path
, example:
$CARTAWORKHOME/CARTAvis/build/cpp/desktop/CARTA --html $CARTAWORKHOME/CARTAvis/carta/html5/desktop/desktopIndex.html
Some of optional parameters:
--scriptPort 9999
for python interface/scratch/some-fits-file.fits
in the endUse this repo, https://github.com/cartavis/deploytask.
Third-party Libraries | Version | license |
---|---|---|
casacore | 2.3+ | GPLv2 |
casa | 5.0.0+ | GPLv2 |
ast | 8.4.0 | LGPLv3 |
gfortran | 4.8+ | GPLv3 |
WCSLIB | 5.15 | LGPLv3 |
CFITSIO | 3.39 | link (NASA license) |
GSL | 2.3 | GPLv3 |
flex | 2.5.37 | link (flex license) |
RapidJSON | 1.02 | MIT |
qooxdoo | 3.5.1 | MIT |
Qt | 5.3+ | LGPLv3 |
Qwt | 6.1.2 | link (Qwt license) |
Python (included for CentOS 6) | 2.7 | link (Python license) |
NumPy (Included for CentOS 6) | BSD | |
Matplotlib (Included for CentOS 6) | link (Matplotlib license) | |
Cython (Included for CentOS 6) | Apache | |
libstdc++ (Included for CentOS 6) | 4.8.1+ | GCC Runtime Exception |
On Mac, start from Qt 5.5, the rpath of dependent Qt library will use @rpath instead of using absolute path.
CARTA desktop version is built to CARTA program + dynamic libs (libCARTA, libcore, many libPlugin built from Qt) and use "a few static Third-party library + many dynamic Third-party library".
It seems that Qt-built dynamic libs do not have Search Path issue, at least before moving CARTA program (for packaging).
We use install_name_tool (Mac) and chrpath or PatchELF (Linux) to specify dynamic linking path of each lib. On mac, CARTA is located in CARTA.app/Contents/MacOS/desktop after building. Linux does not have these folder, so we need to have different handles.
CirclCI (docker): https://circleci.com/gh/CARTAvis/carta
Travis CI (Mac): https://travis-ci.org/CARTAvis/carta/. Mac auto build repo: https://goo.gl/3pRsjs.
https://github.com/CARTAvis/carta/wiki/Server-version-of-CARTA