Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

oneClickToBuildCARTAMacDesktop(Draft)

Grimmer edited this page Aug 7, 2017 · 27 revisions

Know issues

  1. homebrew's Qt 5.7/5.8 will build CARTA successfully, but the final packaged can not be runnable on other macs, fixed and waitting for testing

  2. The Qt 5.8 version which is from Qt installer, will fail to build QWT !! #154

  3. Build: Qt 5.7 installed from Qt installer + Prebuilt QtWebkit Preview 4 on Mac 10.12 is OK, all the functions are working except regionDS9 is not working, this is due to macports' flex becomes 2.6.1, not 2.5.37 anymore. Fixed

  4. If we use homebrew's Qt 5.7 to build, packaging part will not pick up QtWebKit so final CARTA is not working. Fixed.

Target

This is mainly for packaging CARTA and deploy, but it is OK to setup development environment at once, instead of following step by step in https://github.com/CARTAvis/carta/wiki/build.

Step0:

Setup xcode and cpp compiler if you have not setup. Follow, https://github.com/CARTAvis/carta/wiki/Install-Third-Party-For-CARTA-CASA-On-Mac#step1---install-xcode-and-get-clang-compiler

Install Qt from Qt installer if you prefer not to use the default Homebrew's qt which will be installed automatically by the following scripts, or you can accept homebrew'qt but want to install Qt Creator from qt installer. Key points:

  1. (optional) choose Qt 5.7 and uncheck the other qt version to reduce the installation time. Please remember to setupt QT5PATH in the following script.
  2. uncheck some useless SDK, e.g. iOS
  3. Qt creator is installed by default, when using Qt installer.

Step1: Check if you have conflict/old version of some libs needed by CARTA

Conflict: We will prepare the list to let you check, since CARTA starts to fix the version of 3 party libs.

Old: We will move most of 3 party libs to CARTAvis/homebrew-tap, but you may have to manually remove the old version of some 3 party libs. Check this, https://github.com/CARTAvis/carta/wiki/oneClickToBuildCARTAMacDesktop%28Draft%29/_edit#homebrew-tips

Step2: Download all-in-one script

curl -O https://raw.githubusercontent.com/CARTAvis/carta/upgradeToNewNamespace/carta/scripts/local_mac_all.sh

The either step3-1 or step3-2,

Step3-0: (optional) Setup your branch you want to download, then build

In local_mac_all.sh, the default is

branch=upgradeToNewNamespace

Now upgradeToNewNamespace, develop and any branch which is already merging the latest develop all have the latest internal build scripts and can be used.

Step3-1: Use "~/cartahome" as your carta working directory

sudo sh ./local_mac_all.sh

Then the folder, ~/cartahome/CARTAvis will be the git downloaded folder of CARTA.

Step3-2: Use other places as the download folder. If it is $WhereYouWant, append as the 1st parameter

sudo sh ./local_mac_all.sh $WhereYouWant

The other optional parameters you can directly modify the ci_mi.sh script. We may supply the script's parameters way.

Parameter- Qt library path, we use homebrew's Qt5.8 by default, it will download automatically.

export QT5PATH=/usr/local/Cellar/qt/5.8.0_2

Or you can use Qt installer to install the version you want, then change the this QT5PATH in the script, the execute this script. e.g. export QT5PATH=~/Qt/5.8/clang_64

Parameter- Put build folder inside source code folder, change it if you prefer other places.

export CARTABUILDHOME=$cartawork/CARTAvis/build

Parameter- Which version/link of prebuilt QtWebkit it use, the default:

export qtwebkit=qtwebkit-tp4-qt57-darwin 
qtwebkitlink=https://github.com/annulen/webkit/releases/download/qtwebkit-tp4/qtwebkit-tp4-qt57-darwin.tar.xz

CARTA is built for release. change qmake -config release NOSERVER=1 CARTA_BUILD_TYPE=release in local_mac_all.sh if you want to build other types.

Final app/dmg will be in /tmp/ & Final dmg will be the same folder of this script, local_mac_all.sh

What this script install

Some libraries are installed by the global way, some are in the $WhereYouWant/CARTAvis-externals/ThirdParty, so most of them are in your own local folder. So if you choose different places to build for the next time, the results are independent.

The globally installed libraries:

  1. GSL (/usr/local)
  2. libsakura (/usr/local)
  3. All homebrew packages (/usr/local/opt/), but they are installed very soon.

Resume the debug pause function

I setup some breakpoint(pause) to check each step, you can uncomment this line to let the script stop

function pause(){
  read -p "Press [Enter] key to continue"
}

Which libraries need a long time to build or download

  1. Build GSL from its source code
  2. Build CARTA
  3. Build ast, casacore, casa-code
  4. others (e.g. download the source code of casa libs)

homebrew tips

remove all libs: brew list -1 | xargs brew rm

CARTA's homebrew list (for those fixed version libs):

  • [email protected]: 5.7
  • flex: 2.5.37
  • textinfo:6.3, help2man:1.47.4, gettext: 0.19.8.1 (to build flex)
  • bison: 3.0.4
  • gcc: 7.1 (to use its gfortran-7, we still use clang as cpp compiler)
  • fftw: 3.3.6
  • boost-python: 1.63.0 (homebrew will automatically install boost due to the dependency, and travis-ci has pre-installed boost by homebrew)
  • doxygen:1.8.13 (to build libsakura)
  • [email protected]:3.2 (to build libsakura)
  • log4cxx: 0.10
  • pgplot: 5.2.2
  • libxml2: 2.9.4
  • xerces-c: 3.1.4
  • dbus: 1.10.18
Clone this wiki locally