{"id":25663499,"url":"https://github.com/bgeneto/siesta-gcc-mpi","last_synced_at":"2026-03-06T19:02:01.881Z","repository":{"id":138920992,"uuid":"150870208","full_name":"bgeneto/siesta-gcc-mpi","owner":"bgeneto","description":"Instructions to install siesta with gnu compilers and openmpi ","archived":false,"fork":false,"pushed_at":"2021-06-24T03:59:07.000Z","size":73,"stargazers_count":16,"open_issues_count":4,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T05:16:30.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgeneto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-09-29T14:07:46.000Z","updated_at":"2024-08-16T10:44:20.000Z","dependencies_parsed_at":"2023-03-15T04:00:16.564Z","dependency_job_id":null,"html_url":"https://github.com/bgeneto/siesta-gcc-mpi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bgeneto/siesta-gcc-mpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fsiesta-gcc-mpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fsiesta-gcc-mpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fsiesta-gcc-mpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fsiesta-gcc-mpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgeneto","download_url":"https://codeload.github.com/bgeneto/siesta-gcc-mpi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgeneto%2Fsiesta-gcc-mpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30192367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T18:54:55.862Z","status":"ssl_error","status_checked_at":"2026-03-06T18:53:04.013Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T05:16:31.757Z","updated_at":"2026-03-06T19:02:01.821Z","avatar_url":"https://github.com/bgeneto.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 0. Purpose \n\nThis document contains step-by-step instructions to proceed with a (hopefully) successful installation of the SIESTA (Spanish Initiative for Electronic Simulations with Thousands of Atoms) software on Linux (tested with Ubuntu 18.04) using the GCC and OpenMPI tools for parallelism. \n\nTo achieve a parallel build of SIESTA you should ﬁrst determine which type of parallelism you need. It is advised to use MPI for calculations with a moderate number of cores. For hundreds of threads, hybrid parallelism using both MPI and OpenMP may be required.\n\n## 1. Install prerequisite software\n\n*Note: We assume you are running all the commands below as an ordinary user (non-root), so we use `sudo` when required. That's because `mpirun` does NOT like to be executed as root.*\n\n```\nsudo apt install build-essential g++ gfortran libreadline-dev m4 xsltproc -y\n```\n\nNow install OpenMPI or MPICH software and libraries: \n\n```\nsudo apt install openmpi-common openmpi-bin libopenmpi-dev -y\n```\n\n**OR**, if you prefer, install mpich implementation of MPI: \n\n```\nsudo apt install mpich libcr-dev -y\n```\n\nDo NOT install both packages (OpenMPI and MPICH). \n\n## 2. Create required installation folders\n\n```\nSIESTA_DIR=/opt/siesta\nOPENBLAS_DIR=/opt/openblas\nSCALAPACK_DIR=/opt/scalapack \n\nsudo mkdir $SIESTA_DIR $OPENBLAS_DIR $SCALAPACK_DIR\n# temporally loose permissions (we will revert later)\nsudo chmod -R 777 $SIESTA_DIR $OPENBLAS_DIR $SCALAPACK_DIR\n```\n\n## 3. Install prerequisite libraries \n\nIn order to run siesta in parallel using MPI you need non-threaded blas and lapack libraries along with a standard scalapack library.\n\n#### 3.1. Install single-threaded openblas library from source\n\n*Note: apt installs a threaded version of openblas by default, I think this is not suitable for this MPI build of siesta.*\n\n```\ncd $OPENBLAS_DIR\nwget -O OpenBLAS.tar.gz https://ufpr.dl.sourceforge.net/project/openblas/v0.3.7/OpenBLAS%200.3.7%20version.tar.gz\ntar xzf OpenBLAS.tar.gz \u0026\u0026 rm OpenBLAS.tar.gz\ncd \"$(find . -type d -name xianyi-OpenBLAS*)\"\nmake DYNAMIC_ARCH=0 CC=gcc FC=gfortran HOSTCC=gcc BINARY=64 INTERFACE=64 \\\n  NO_AFFINITY=1 NO_WARMUP=1 USE_OPENMP=0 USE_THREAD=0 USE_LOCKING=1 LIBNAMESUFFIX=nonthreaded\nmake PREFIX=$OPENBLAS_DIR LIBNAMESUFFIX=nonthreaded install\ncd $OPENBLAS_DIR \u0026\u0026 rm -rf \"$(find $OPENBLAS_DIR -maxdepth 1 -type d -name xianyi-OpenBLAS*)\"\n```\n\n#### 3.2. Install scalapack from source\n\n```\nmpiincdir=\"/usr/include/mpich\"\nif [ ! -d \"$mpiincdir\" ]; then mpiincdir=\"/usr/lib/x86_64-linux-gnu/openmpi/include\" ; fi\ncd $SCALAPACK_DIR\nwget http://www.netlib.org/scalapack/scalapack_installer.tgz -O ./scalapack_installer.tgz\ntar xf ./scalapack_installer.tgz\nmkdir -p $SCALAPACK_DIR/scalapack_installer/build/download/\nwget https://github.com/Reference-ScaLAPACK/scalapack/archive/v2.1.0.tar.gz -O $SCALAPACK_DIR/scalapack_installer/build/download/scalapack.tgz\ncd ./scalapack_installer\n./setup.py --prefix $SCALAPACK_DIR --blaslib=$OPENBLAS_DIR/lib/libopenblas_nonthreaded.a \\\n  --lapacklib=$OPENBLAS_DIR/lib/libopenblas_nonthreaded.a --mpibindir=/usr/bin --mpiincdir=$mpiincdir\n```\n\n*Note: Answer 'b' if asked: 'Which BLAS library do you want to use ?'*\n\n\n## 4. Install siesta from source\n\n```\ncd $SIESTA_DIR\nwget https://launchpad.net/siesta/4.1/4.1-b3/+download/siesta-4.1-b3.tar.gz\ntar xzf ./siesta-4.1-b3.tar.gz \u0026\u0026 rm ./siesta-4.1-b3.tar.gz\n```\n\n#### 4.1. Install siesta library dependencies from source\n\nInstall the fortran-lua-hook library (flook):\n\n```\ncd $SIESTA_DIR/siesta-4.1-b3/Docs\nwget https://github.com/ElectronicStructureLibrary/flook/releases/download/v0.7.0/flook-0.7.0.tar.gz\n(./install_flook.bash 2\u003e\u00261) | tee install_flook.log\n```\n\nInstall netcdf dependency (required and slow, grab a coffee):\n\n```\ncd $SIESTA_DIR/siesta-4.1-b3/Docs\nwget https://zlib.net/zlib-1.2.11.tar.gz\nwget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.18/src/hdf5-1.8.18.tar.bz2\nwget -O netcdf-c-4.4.1.1.tar.gz https://github.com/Unidata/netcdf-c/archive/v4.4.1.1.tar.gz\nwget -O netcdf-fortran-4.4.4.tar.gz https://github.com/Unidata/netcdf-fortran/archive/v4.4.4.tar.gz\n(./install_netcdf4.bash 2\u003e\u00261) | tee install_netcdf4.log\n```\n\nIf anything goes wrong in this step you can check the `install_netcdf4.log` log file.\n\n#### 4.2. Download our custom 'arch.make' file for GCC + OpenMPI/MPICH build \n\n```\ncd $SIESTA_DIR/siesta-4.1-b3/Obj\nwget -O arch.make https://raw.githubusercontent.com/bgeneto/siesta-gcc-mpi/master/gcc-mpi-arch.make\n```\n\n#### 4.3. Build siesta executable \n\n```\ncd $SIESTA_DIR/siesta-4.1-b3/Obj\nsh ../Src/obj_setup.sh\nmake OBJDIR=Obj\n```\n\n## 5. Revert to default permissions and ownership \n\nJust in case...\n\n```\nsudo chown -R root:root $SIESTA_DIR $OPENBLAS_DIR $SCALAPACK_DIR\nsudo chmod -R 755 $SIESTA_DIR $OPENBLAS_DIR $SCALAPACK_DIR\n```\n\n## 6. Test siesta\n\nLet's copy siesta `Test` directory to our home (where we have all necessary permissions): \n\n```\nmkdir -p $HOME/siesta/siesta-4.1-b3\nrsync -a $SIESTA_DIR/siesta-4.1-b3/Tests/ $HOME/siesta/siesta-4.1-b3/Tests/\n```\n\nNow create a symbolic link to siesta executable \n\n```\ncd $HOME/siesta/siesta-4.1-b3\nln -s $SIESTA_DIR/siesta-4.1-b3/Obj/siesta\n```\n\nFinally run some test job:\n\n```\ncd $HOME/siesta/siesta-4.1-b3/Tests/h2o_dos/\nmake\n```\n\nWe should see the following message:\n```\n===\u003e SIESTA finished successfully\n```\n\n## 7. Create a symbolic link for every user\n\n\n```\nSIESTA_DIR=/opt/siesta\nfor USER in $(ls /home)\ndo\n    if [ \"$USER\" == \"lost+found\" ]\n    then\n        continue\n    else\n        sudo -u $USER mkdir /home/$USER/bin\n        sudo -u $USER ln -sf $SIESTA_DIR/siesta-4.1-b3/Obj/siesta /home/$USER/bin/siesta\n    fi\ndone\n```\n\n\n## 8. Learning to use siesta \n\nRead the [manual](https://siesta-project.github.io/bsc2017/siesta-4.1.pdf).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgeneto%2Fsiesta-gcc-mpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgeneto%2Fsiesta-gcc-mpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgeneto%2Fsiesta-gcc-mpi/lists"}