Kategorie: Mac OS X

SPACK and Intel Parallel Studio: „error while loading shared libraries: libimf.so“

Spack is a package manager for supercomputers, Linux, and macOS. It makes installing scientific software easy. With Spack, you can build a package with multiple versions, configurations, platforms, and compilers, and all of these builds can coexist on the same machine.

However, when using the Intel Compiler as compiler, I got the following error for some packages:

 error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

To solve this, edit your ~/.spack/linux/compilers.yaml file and set the extra_rpaths to your Intel Compiler libraries directory:

- compiler:
    environment: {}
    extra_rpaths: [/opt/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64/]
    flags: {}
    modules: []
    operating_system: centos7
      cc: /opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64/icc
      cxx: /opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64/icpc
      f77: /opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64/ifort
      fc: /opt/intel/compilers_and_libraries_2018.1.163/linux/bin/intel64/ifort
    spec: intel@18.0.1
    target: x86_64

Customizing Bootstrap 4 without changing the core files

A simple instruction to customize the Bootstrap 4.0 using SASS and Autoprefixer.

But why? You can either…

  1. download the compiled version of Bootstrap or
  2. use the source of Bootstrap 4 and compile a custom version or
  3. use the CDN server

When you choose number 2, then it’s necessary to use SASS for compiling the style sheet and Autoprefixer for CSS vendor prefixing. And this is how to get a customized version of Bootstrap:

First make sure, you’ve installed Node.js and SASS.

Then create an empty folder my_directory with the following folders and some empty text files:

+- node_modules [folder]
+- custom.scss
+- package.json

The node_modules folder is required for some node.js modules. custom.css will hold all your customized stylesheets and package.json is used for some node.js package settings. You will see this later.

Now it’s time to load the current version of Bootstrap. Download the source of Bootstrap 4 and extract the zip to the folder /node_modules/bootstrap/.

Point your terminal to my_directory and install some node.js modules with the following command:

npm install postcss-cli autoprefixer npm-run-all

Now you can open the custom.scss file and add some costumized styles. This file can look like this:

// Custom.scss

$mixable: #ca0027;

$colors: (
 "mixable": $mixable,
$theme-colors: (
 "primary": $mixable

// Required
@import "node_modules/bootstrap/scss/bootstrap";

In this simple example, we just set a new color and use this color as primary color. A more detailed description on how to customize your theme can be found in the Bootstrap docs.

Let’s say we have made all of our customizations, so let’s open the empty file package.json. Add the following lines, which are required to combine your custom stylesheet and the Bootstrap source:

  "scripts": {
    "style":"sass custom.scss | postcss --use autoprefixer -o custom.css",
    "style-min":"sass custom.scss --style compressed | postcss --use autoprefixer -o custom.min.css",
    "all":"npm-run-all --parallel style style-min"

This file contains three scripts, which can be executed like this:

To create the output file custom.css:

npm run style

To create a compressed output file custom.min.css:

npm run style-min

And to create both files at once:

npm run all

That’s it. Keep in mind, that this will just compile the stylesheet. To compile the javascript, you should refer to the Bootstrap docs and the build tools there.

VI oder VIM beenden

Um den bei vielen Linux und Unix Installationen und Tools (wie bspw. git) standardmäßig genutzten VI Editor zu beenden muss man mit der „ESC“-Taste in den Kommandomodus wechseln (am besten mehrfach drücken um ggf. schon eingegeben Kommandos abzubrechen) . Und dort dann „:q“ eingeben und Enter drücken.
Dies beendet VIM wenn vorher nichts geändert wurde. Wurde etwas am Text der geöffneten Datei geändert und man will dies speichern so nutzt man den Befehl „:wq“. Will man die Änderungen verwerfen und VI verlassen, so hilft „:q!“.

Less (CSS) unter macOS installieren

Der einfachste Weg Less auf einem Server zu installieren ist über npm (dem node.js Paketmanager) mit:

$ npm install -g less

Wenn nicht vorhanden: Command Line Tools für Xcode installieren

xcode-select --install

Wenn nicht vorhanden: HomeBrew installieren

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Wenn nicht vorhanden: Node.js installieren

brew install node

LessCSS installieren

sudo npm install -g less

Nun lassen sich die lessc Befehle ausführen.