Skip to content

Commit

Permalink
test ubuntu 24.04 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lixun910 committed Aug 21, 2024
1 parent 6ace79a commit 82a77be
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,19 @@ jobs:
include:
- distro: 'ubuntu-24.04'
pre: 'noble'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.1 -lEGL -ljavascriptcoregtk-4.1'
- distro: 'ubuntu-22.04'
pre: 'jammy'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.0 -lEGL -ljavascriptcoregtk-4.0'
- distro: 'ubuntu-20.04'
pre: 'focal'
ldflags: '-lgdal -lcurl -L/usr/lib/x86_64-linux-gnu -lz -lwebkit2gtk-4.0 -lEGL -ljavascriptcoregtk-4.0'

env:
platform: ${{ matrix.distro }}
GEODA_VER: '1.22.0'
TARGET_OS: ${{ matrix.pre }}
EXTRA_GEODA_LD_FLAGS: ${{ matrix.ldflags }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down Expand Up @@ -83,6 +87,7 @@ jobs:
export WORK_DIR=$PWD
export OS=${{ env.TARGET_OS }}
export VER=${{ env.GEODA_VER }}
export EXTRA_GEODA_LD_FLAGS=${{ env.EXTRA_GEODA_LD_FLAGS }}
export APT="sudo apt-get"
cd BuildTools/ubuntu
./install.sh
Expand Down
23 changes: 1 addition & 22 deletions BuildTools/ubuntu/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,8 @@ cd ubuntu
export GEODA_HOME=$PWD
echo $GEODA_HOME

# Install libgdal
export DEBIAN_FRONTEND=noninteractive
$APT update -y
# fix curl 60 error
$APT install -y ca-certificates libgnutls30
echo '-k' > ~/.curlrc
$APT install -y libpq-dev
$APT install -y gdal-bin
$APT install -y libgdal-dev
$APT install -y unzip cmake dh-autoreconf libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev

if [ $OS = 'jammy' ] ; then
$APT install -y libwebkit2gtk-4.0-dev
elif [ $OS = 'focal' ] ; then
$APT install -y libwebkit2gtk-4.0-dev
elif [ $OS = 'noble' ] ; then
$APT install -y libwebkit2gtk-4.1-dev
else
$APT install -y libwebkitgtk-3.0-dev
fi

# Build GeoDa
cp ../../GeoDamake.$OS.opt ../../GeoDamake.opt
cp ../../GeoDamake.ubuntu.opt ../../GeoDamake.opt
make -j$(nproc)
make app

Expand Down
78 changes: 78 additions & 0 deletions GeoDamake.ubuntu.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
GeoDa_ROOT = $(GEODA_HOME)/../..

TARGET = GeoDa

CC = /usr/bin/gcc
CXX = /usr/bin/g++
LD = /usr/bin/g++
RM = /bin/rm -f

WXLIBS = $(shell $(GEODA_HOME)/libraries/bin/wx-config --libs xrc,stc,richtext,ribbon,propgrid,aui,gl,html,webview,qa,adv,core,xml,net,base)
WX_HEADER = $(shell $(GEODA_HOME)/libraries/bin/wx-config --cppflags)

LIBS = $(WXLIBS) \
$(GEODA_HOME)/temp/CLAPACK-3.2.1/lapack.a \
$(GEODA_HOME)/temp/CLAPACK-3.2.1/libf2c.a \
$(GEODA_HOME)/temp/CLAPACK-3.2.1/blas.a \
$(GEODA_HOME)/temp/boost/stage/lib/libboost_date_time.a \
$(GEODA_HOME)/temp/boost/stage/lib/libboost_thread.a \
$(GEODA_HOME)/temp/boost/stage/lib/libboost_system.a \
$(GEODA_HOME)/libraries/lib/libjson_spirit.a \
-L$(GEODA_HOME)/libraries/lib $(EXTRA_GEODA_LD_FLAGS)
# Note: Library -lrtmp causes a missing library problem at runtime on
# Ubuntu 14.10 and later.

BOOST_HEADER = -I$(GEODA_HOME)/temp/boost

EIGEN_HEADER = -I$(GEODA_HOME)/temp/eigen3 -I$(GEODA_HOME)/temp/spectra/include

GDAL_HEADER = -I/usr/include/gdal -D__PROJ6__

USER_DEFS = -I$(GEODA_HOME)/libraries/include

CPPFLAGS = -std=gnu++14 -I$(GeoDa_ROOT)
CFLAGS = -O2 -Wdeclaration-after-statement $(USER_DEFS) $(GDAL_HEADER) $(EIGEN_HEADER)
CXXFLAGS = -std=gnu++14 -O2 $(USER_DEFS) $(WX_HEADER) $(BOOST_HEADER) $(GDAL_HEADER) $(EIGEN_HEADER)
LDFLAGS =

OBJ_EXT = o

#
# generic library rules
#

#
# gdal and ogr low level drivers use the following default rules in order to
# populate the ../o/ directory with all object and library object files
#

O_OBJ = $(foreach file,$(OBJ),../o/$(file))
T_OBJ = $(foreach file,$(OBJ),o/$(file))

../o/%.$(OBJ_EXT): %.c
$(CC) $(CFLAGS) -c -o $@ $<

../o/%.$(OBJ_EXT): %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

o/%.$(OBJ_EXT): %.c
$(CC) $(CFLAGS) -c -o $@ $<

o/%.$(OBJ_EXT): %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

%.$(OBJ_EXT): %.c
$(CC) $(CFLAGS) -c -o $@ $<

%.$(OBJ_EXT): %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<

#
# default rules for handling subdirectories
#

%-target:
$(MAKE) -C $*

%-clean:
$(MAKE) -C $* clean

0 comments on commit 82a77be

Please sign in to comment.