{"action":"created","issue":{"url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/1842","labels_url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/1842/labels{/name}","comments_url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/1842/comments","events_url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/1842/events","html_url":"https://github.com/hpcugent/easybuild-easyconfigs/issues/1842","id":100485688,"number":1842,"title":"OpenFOAM patches introduce environment variables into wmake build system","user":{"login":"FokkeDijkstra","id":4125380,"avatar_url":"https://avatars.githubusercontent.com/u/4125380?v=3","gravatar_id":"","url":"https://api.github.com/users/FokkeDijkstra","html_url":"https://github.com/FokkeDijkstra","followers_url":"https://api.github.com/users/FokkeDijkstra/followers","following_url":"https://api.github.com/users/FokkeDijkstra/following{/other_user}","gists_url":"https://api.github.com/users/FokkeDijkstra/gists{/gist_id}","starred_url":"https://api.github.com/users/FokkeDijkstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FokkeDijkstra/subscriptions","organizations_url":"https://api.github.com/users/FokkeDijkstra/orgs","repos_url":"https://api.github.com/users/FokkeDijkstra/repos","events_url":"https://api.github.com/users/FokkeDijkstra/events{/privacy}","received_events_url":"https://api.github.com/users/FokkeDijkstra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-12T07:37:38Z","updated_at":"2015-08-12T08:00:57Z","closed_at":null,"body":"I've installed OpenFOAM 2.3.1 using easybuild. I got questions from our users because they were not able to build their own OpenFOAM code using the OpenFOAM wmake build system.\r\n\r\nI found out that in the wmake rules the environment variables $(MPICC) $(MPICXX) $(CFLAGS) and $(CXXFLAGS) were introduced. Since these are not set by the goolfc toolchain the build system breaks. And even if MPICC and MPICXX are set unoptimised code will be produced.\r\n\r\nThese changes in the wmake build system are introduced by the patch file cleanup-OpenFOAM-2.3.1.patch.\r\nI am now fixing this by removing the settings for the compiler flags and introducing mpicc and mpic++ as compiler settings.\r\n\r\nCan someone explain me the reason for these specific patches?\r\n"},"comment":{"url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/comments/130210160","html_url":"https://github.com/hpcugent/easybuild-easyconfigs/issues/1842#issuecomment-130210160","issue_url":"https://api.github.com/repos/hpcugent/easybuild-easyconfigs/issues/1842","id":130210160,"user":{"login":"boegel","id":620876,"avatar_url":"https://avatars.githubusercontent.com/u/620876?v=3","gravatar_id":"","url":"https://api.github.com/users/boegel","html_url":"https://github.com/boegel","followers_url":"https://api.github.com/users/boegel/followers","following_url":"https://api.github.com/users/boegel/following{/other_user}","gists_url":"https://api.github.com/users/boegel/gists{/gist_id}","starred_url":"https://api.github.com/users/boegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boegel/subscriptions","organizations_url":"https://api.github.com/users/boegel/orgs","repos_url":"https://api.github.com/users/boegel/repos","events_url":"https://api.github.com/users/boegel/events{/privacy}","received_events_url":"https://api.github.com/users/boegel/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T08:00:57Z","updated_at":"2015-08-12T08:00:57Z","body":"This patch is there to make ``wmake`` honor the build environment (`$MPICC`, `$CFLAGS`, etc.) as it is defined by EasyBuild when building/installing OpenFOAM.\r\n\r\nBut you're right, we've also had issues with people running into weird problems when trying to compile their own solvers. I just didn't realise it was our patch that was the cause of this problem...\r\n\r\nRather than removing those flags altogether, they should be modified such that the original value stays in place if they're not set. I.e., rather than doing this:\r\n\r\n```diff\r\n-cc          = icc\r\n-cOPT        = -O3 -no-prec-div\r\n+cc          = $(MPICC)\r\n+cOPT        = $(CFLAGS)\r\n```\r\n\r\nwe should be doing this instead (needs to be tested):\r\n\r\n```diff\r\n-cc          = icc\r\n-cOPT        = -O3 -no-prec-div\r\n+cc          = ${MPICC:=icc}\r\n+cOPT        = ${CFLAGS:=-O3 -no-prec-div}\r\n```\r\nCan you see whether changing the patch to do this resolves the problem?"}}