Skip to content

Instantly share code, notes, and snippets.

@jeff-pal
Last active April 25, 2024 00:22
Show Gist options
  • Save jeff-pal/999332747feec925397272033a5ad7fd to your computer and use it in GitHub Desktop.
Save jeff-pal/999332747feec925397272033a5ad7fd to your computer and use it in GitHub Desktop.
How to compile and install pgModeler on macOs - Apple Silicon M1- arm64

Dependencies

Step-by-step

Clone repos

# Clone pgmodeler
git clone https://github.com/pgmodeler/pgmodeler

# Clone plugins
git clone https://github.com/pgmodeler/plugins.git

Set variables

PLEASE REPLACE EACH VARIABLE VALUE ACCORDING TO YOUR SYSTEM PATH!

QT_ROOT=/opt/homebrew/Cellar/qt@5/5.15.3
PGMODELER_PLUGINS_ROOT=/Applications/pgModeler.app/Contents/MacOS/plugins
PGMODELER_SOURCE_ROOT=/Users/myuser/dev/pgmodeler/
PGMODELER_LIBRARIES_ROOT=/Library/PostgreSQL/14/lib

Build and compile plugins

cd plugins
git checkout main
$QT_ROOT/bin/qmake plugins.pro PGMODELER_PLUGINS=$PGMODELER_PLUGINS_ROOT
                               PGMODELER_SRC=$PGMODELER_SOURCE_ROOT
                               PGMODELER_LIBS=$PGMODELER_LIBRARIES_ROOT
make && make install
cd ..

Build and compile pgModeler

Update build script

Open the file pgmodeler.pri, in your favorite editor, and update the variables PGSQL_LIB, PGSQL_INC, XML_INC and XML_LIB, according to your system:

macx {
  PGSQL_LIB = /Library/PostgreSQL/14/lib/libpq.dylib
  PGSQL_INC = /Library/PostgreSQL/14/include
  XML_INC = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2
  XML_LIB = /usr/lib/libxml2.dylib
  ...
}

Build, Compile and Install pgModeler

cd pgmodeler
git checktout v0.9.4
$QT_ROOT/bin/qmake -r CONFIG+=release pgmodeler.pro
make
make install

Issues

unknown type name 'QRegExp'

In file included from src/schemaparser.cpp:19:
src/schemaparser.h:49:16: error: unknown type name 'QRegExp'
                static const QRegExp AttribRegExp;
                             ^
src/schemaparser.cpp:68:7: error: unknown type name 'QRegExp'
const QRegExp SchemaParser::AttribRegExp=QRegExp("^([a-z])([a-z]*|(\\d)*|(\\-)*|(_)*)+", Qt::CaseInsensitive);
      ^
src/schemaparser.cpp:68:42: error: use of undeclared identifier 'QRegExp'
const QRegExp SchemaParser::AttribRegExp=QRegExp("^([a-z])([a-z]*|(\\d)*|(\\-)*|(_)*)+", Qt::CaseInsensitive);
                                         ^
3 errors generated.
make[1]: *** [obj/schemaparser.o] Error 1
make: *** [sub-libs-libparsers-make_first-ordered] Error 2

Solution

brew install qt@5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment