Re: SPOOLES MT routines

2022-08-05 Thread Ryan Schmidt
On Aug 5, 2022, at 17:45, Mark Brethen wrote:

> Note that the pre-build approach is overriding the makefile cflags, makefile 
> was patched to cflags += , etc. How do I prevent this?

Setting variables like CFLAGS as arguments (e.g. build.args) overrides anything 
specified in the Makefile. That's the purpose of specifying them as args.

If you don't want to override the Makefile, then specify them as environment 
variables instead (e.g. build.env).

Note that *.args and *.env have different quoting rules.

For *.args you would use e.g.

build.args  CFLAGS="foo bar baz"

For *.env you would use e.g.

build.env   "CFLAGS=foo bar baz"

You must also make sure that each environment variable is its own list item. In 
your portfile you're currently combining multiple different variables into a 
single string which isn't going to work for env. You'll want to use a list 
instead of a string. For example (untested):

set args[list "CFLAGS=${cflags}" "FFLAGS=${fflags}" 
"LDFLAGS=${ldflags}"]

build.args-append   {*}${args}



Re: SPOOLES MT routines

2022-08-05 Thread Mark Brethen
So, moving from a post-patch CFLAGS, etc to a pre-build build.args CalculiX now does not build. So I compared them.Post-Patch::info:build Executing:  cd "/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src" && /usr/bin/make -j1 -w :debug:build system:  cd "/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src" && /usr/bin/make -j1 -w :info:build make: Entering directory `/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src':info:build /opt/local/bin/mpicc-mpich-mp -Wall -O2 -pthread -Os -arch x86_64 -I../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DUSE_MT=1 -DBLAS_LIBRARIES=vecLibFort -DLAPACK_LIBRARIES=vecLibFort -c ccx_2.18.cPre-Build::info:build Executing:  cd "/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src" && /usr/bin/make -j1 -w CFLAGS="-Os -arch x86_64" FFLAGS="-Os -m64 -fallow-argument-mismatch" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64" :debug:build system:  cd "/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src" && /usr/bin/make -j1 -w CFLAGS="-Os -arch x86_64" FFLAGS="-Os -m64 -fallow-argument-mismatch" LDFLAGS="-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64" :info:build make: Entering directory `/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/ccx_2.18/src'Note that the pre-build approach is overriding the makefile cflags, makefile was patched to cflags += , etc. How do I prevent this?pre-build log: https://pastebin.com/2SrmjAv9post-patch log is 1.8 MB — not uploaded

Portfile
Description: Binary data


Portfile.new
Description: Binary data


patch-ccx-build.diff
Description: Binary data


patch-spooles-make.inc.diff
Description: Binary data

Mark Brethenmark.bret...@gmail.com


On Aug 5, 2022, at 3:04 PM, Ryan Schmidt  wrote:On Aug 5, 2022, at 14:32, Mark Brethen wrote:pre-build {    set cflags  "${configure.cflags} [get_canonical_archflags cc]"    set ldflags "${configure.ldflags} [get_canonical_archflags ld]"    # workaround for Rank mismatch between actual argument    set ver [regsub -all {[[:alpha:]]+} ${compilers.gcc_default} {}]    if { ${ver} >= 10 } {    set fflags "${configure.fflags} [get_canonical_archflags fc] -fallow-argument-mismatch"    } else {    set fflags "${configure.fflags} [get_canonical_archflags fc]"    }    set args    "CFLAGS=${cflags} FFLAGS=${fflags} LDFLAGS=${ldflags}"    build.args-append   ${args}    # Build serial spooles library    ui_info "Building spooles"    system -W ${workpath}/spooles.2.2 "${args} ${build.cmd} lib"    # Extend library with multi-threading (MT) subroutines    system -W ${workpath}/spooles.2.2/MT/src "${args} ${build.cmd} makeLib"}:info:build Building spooles:debug:build system -W /opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/spooles.2.2: CFLAGS=-Os -arch x86_64 FFLAGS=-Os -m64 -fallow-argument-mismatch LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64 /usr/bin/make lib:info:build sh: -arch: command not foundIt worked when I patched the makefile with the flags, but these should probably be passed at build. What did I miss?Quoting?set args    "CFLAGS=\"${cflags}\" FFLAGS=\"${fflags}\" LDFLAGS=\"${ldflags}\""

Re: SPOOLES MT routines

2022-08-05 Thread Ryan Schmidt
On Aug 5, 2022, at 14:32, Mark Brethen wrote:
> 
> pre-build {
> set cflags  "${configure.cflags} [get_canonical_archflags cc]"
> set ldflags "${configure.ldflags} [get_canonical_archflags ld]"
> 
> # workaround for Rank mismatch between actual argument
> set ver [regsub -all {[[:alpha:]]+} ${compilers.gcc_default} {}]
> 
> if { ${ver} >= 10 } {
> set fflags "${configure.fflags} [get_canonical_archflags fc] 
> -fallow-argument-mismatch"
> } else {
> set fflags "${configure.fflags} [get_canonical_archflags fc]"
> }
> 
> set args"CFLAGS=${cflags} FFLAGS=${fflags} LDFLAGS=${ldflags}"
> 
> build.args-append   ${args}
> 
> # Build serial spooles library
> ui_info "Building spooles"
> system -W ${workpath}/spooles.2.2 "${args} ${build.cmd} lib"
> 
> # Extend library with multi-threading (MT) subroutines
> system -W ${workpath}/spooles.2.2/MT/src "${args} ${build.cmd} makeLib"
> }
> 
> 
> :info:build Building spooles
> :debug:build system -W 
> /opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/spooles.2.2:
>  CFLAGS=-Os -arch x86_64 FFLAGS=-Os -m64 -fallow-argument-mismatch 
> LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names 
> -Wl,-rpath,/opt/local/lib/libgcc -arch x86_64 /usr/bin/make lib
> :info:build sh: -arch: command not found
> 
> It worked when I patched the makefile with the flags, but these should 
> probably be passed at build. What did I miss?

Quoting?

set args"CFLAGS=\"${cflags}\" FFLAGS=\"${fflags}\" LDFLAGS=\"${ldflags}\""



Re: SPOOLES MT routines

2022-08-05 Thread Mark Brethen
Need to build spooles library before CalculiX-ccx:

pre-build {
set cflags  "${configure.cflags} [get_canonical_archflags cc]"
set ldflags "${configure.ldflags} [get_canonical_archflags ld]"

# workaround for Rank mismatch between actual argument
set ver [regsub -all {[[:alpha:]]+} ${compilers.gcc_default} {}]

if { ${ver} >= 10 } {
set fflags "${configure.fflags} [get_canonical_archflags fc] 
-fallow-argument-mismatch"
} else {
set fflags "${configure.fflags} [get_canonical_archflags fc]"
}

set args"CFLAGS=${cflags} FFLAGS=${fflags} LDFLAGS=${ldflags}"

build.args-append   ${args}

# Build serial spooles library
ui_info "Building spooles"
system -W ${workpath}/spooles.2.2 "${args} ${build.cmd} lib"

# Extend library with multi-threading (MT) subroutines
system -W ${workpath}/spooles.2.2/MT/src "${args} ${build.cmd} makeLib"
}


:info:build Building spooles
:debug:build system -W 
/opt/local/var/macports/build/_Users_marbre_ports_cad_CalculiX-ccx/CalculiX-ccx/work/spooles.2.2:
 CFLAGS=-Os -arch x86_64 FFLAGS=-Os -m64 -fallow-argument-mismatch 
LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names 
-Wl,-rpath,/opt/local/lib/libgcc -arch x86_64 /usr/bin/make lib
:info:build sh: -arch: command not found

It worked when I patched the makefile with the flags, but these should probably 
be passed at build. What did I miss?

Mark Brethen
mark.bret...@gmail.com



> On Jul 30, 2022, at 11:40 AM, Chris Jones  wrote:
> 
> 
> 
>> On 30 Jul 2022, at 5:11 pm, Mark Brethen  wrote:
>> 
>> Now that I think about it, a subport would not work since the ccx makefile 
>> expects spooles.a in its workpath.
> 
> No, it would still be perfectly fine. Just make the subport a build 
> dependency, and then pre-build just copy the static library from wherever the 
> subport installs it, to where ever it needs to be in the work path. Ugly, it 
> would be better to just point the makefile at the installed lib, but if it 
> really has to have it in a certain place that can be accommodated.
> 
>> 
>> 
>> Mark Brethen
>> mark.bret...@gmail.com 
>> 
>> 
>> 
>>> On Jul 30, 2022, at 11:01 AM, Mark Brethen >> > wrote:
>>> 
>>> For the basic installation of CalculiX-ccx the library spooles.a with the 
>>> single- and multi-threading (MT) routines of SPOOLES is required. Currently 
>>> I have defined a pre-build phase for spooles, although a subport could 
>>> work.There are some entries in its makefile that will need to be patched:
>>> 
>>> #
>>> #-
>>> #
>>> #  MPI install library
>>> #
>>> # MPI_INSTALL_DIR = 
>>>   MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
>>> #
>>> #-
>>> #
>>> #  MPI library path
>>> #
>>> # for sgi
>>> #
>>> # MPI_LIB_PATH = 
>>> #
>>> # for solaris
>>> #
>>>   MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/solaris/ch_p4
>>> #
>>> # for hp
>>> #
>>> # MPI_LIB_PATH = 
>>> #
>>> #-
>>> #
>>> #  MPI libraries 
>>> #
>>> # for solaris
>>> #
>>>   MPI_LIBS = $(MPI_LIB_PATH) -D_REENTRANT -lmpi -lsocket -lnsl -lthread
>>> #
>>> # for sgi
>>> #
>>> # MPI_LIBS = $(MPI_LIB_PATH) -lmpi -lpthread 
>>> #
>>> # for hp
>>> # MPI_LIBS = -lpthread
>>> # MPI_LIBS = $(MPI_LIB_PATH) -lpthread 
>>> #
>>> #-
>>> #
>>> #  MPI include path
>>> #
>>> # MPI_INCLUDE_DIR = 
>>>   MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
>>> #
>>> #-
>>> 
>>> The spooles.a library source is packaged with ccx and static linked. Would 
>>> a build dependency on mpich suffice? 
>>> 
>>> Thanks,
>>> Mark
>>> 
>>> 
>>> 
>> 



Re: SPOOLES MT routines

2022-07-30 Thread Chris Jones


> On 30 Jul 2022, at 5:11 pm, Mark Brethen  wrote:
> 
> Now that I think about it, a subport would not work since the ccx makefile 
> expects spooles.a in its workpath.

No, it would still be perfectly fine. Just make the subport a build dependency, 
and then pre-build just copy the static library from wherever the subport 
installs it, to where ever it needs to be in the work path. Ugly, it would be 
better to just point the makefile at the installed lib, but if it really has to 
have it in a certain place that can be accommodated.

> 
> 
> Mark Brethen
> mark.bret...@gmail.com
> 
> 
> 
>> On Jul 30, 2022, at 11:01 AM, Mark Brethen  wrote:
>> 
>> For the basic installation of CalculiX-ccx the library spooles.a with the 
>> single- and multi-threading (MT) routines of SPOOLES is required. Currently 
>> I have defined a pre-build phase for spooles, although a subport could 
>> work.There are some entries in its makefile that will need to be patched:
>> 
>> #
>> #-
>> #
>> #  MPI install library
>> #
>> # MPI_INSTALL_DIR = 
>>   MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
>> #
>> #-
>> #
>> #  MPI library path
>> #
>> # for sgi
>> #
>> # MPI_LIB_PATH = 
>> #
>> # for solaris
>> #
>>   MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/solaris/ch_p4
>> #
>> # for hp
>> #
>> # MPI_LIB_PATH = 
>> #
>> #-
>> #
>> #  MPI libraries 
>> #
>> # for solaris
>> #
>>   MPI_LIBS = $(MPI_LIB_PATH) -D_REENTRANT -lmpi -lsocket -lnsl -lthread
>> #
>> # for sgi
>> #
>> # MPI_LIBS = $(MPI_LIB_PATH) -lmpi -lpthread 
>> #
>> # for hp
>> # MPI_LIBS = -lpthread
>> # MPI_LIBS = $(MPI_LIB_PATH) -lpthread 
>> #
>> #-
>> #
>> #  MPI include path
>> #
>> # MPI_INCLUDE_DIR = 
>>   MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
>> #
>> #-
>> 
>> The spooles.a library source is packaged with ccx and static linked. Would a 
>> build dependency on mpich suffice? 
>> 
>> Thanks,
>> Mark
>> 
>> 
>> 
> 


Re: SPOOLES MT routines

2022-07-30 Thread Mark Brethen
Now that I think about it, a subport would not work since the ccx makefile 
expects spooles.a in its workpath.


Mark Brethen
mark.bret...@gmail.com



> On Jul 30, 2022, at 11:01 AM, Mark Brethen  wrote:
> 
> For the basic installation of CalculiX-ccx the library spooles.a with the 
> single- and multi-threading (MT) routines of SPOOLES is required. Currently I 
> have defined a pre-build phase for spooles, although a subport could 
> work.There are some entries in its makefile that will need to be patched:
> 
> #
> #-
> #
> #  MPI install library
> #
> # MPI_INSTALL_DIR = 
>   MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
> #
> #-
> #
> #  MPI library path
> #
> # for sgi
> #
> # MPI_LIB_PATH = 
> #
> # for solaris
> #
>   MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/solaris/ch_p4
> #
> # for hp
> #
> # MPI_LIB_PATH = 
> #
> #-
> #
> #  MPI libraries 
> #
> # for solaris
> #
>   MPI_LIBS = $(MPI_LIB_PATH) -D_REENTRANT -lmpi -lsocket -lnsl -lthread
> #
> # for sgi
> #
> # MPI_LIBS = $(MPI_LIB_PATH) -lmpi -lpthread 
> #
> # for hp
> # MPI_LIBS = -lpthread
> # MPI_LIBS = $(MPI_LIB_PATH) -lpthread 
> #
> #-
> #
> #  MPI include path
> #
> # MPI_INCLUDE_DIR = 
>   MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
> #
> #-
> 
> The spooles.a library source is packaged with ccx and static linked. Would a 
> build dependency on mpich suffice? 
> 
> Thanks,
> Mark
> 
> 
> 



SPOOLES MT routines

2022-07-30 Thread Mark Brethen
For the basic installation of CalculiX-ccx the library spooles.a with the 
single- and multi-threading (MT) routines of SPOOLES is required. Currently I 
have defined a pre-build phase for spooles, although a subport could work.There 
are some entries in its makefile that will need to be patched:

#
#-
#
#  MPI install library
#
# MPI_INSTALL_DIR = 
  MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
#
#-
#
#  MPI library path
#
# for sgi
#
# MPI_LIB_PATH = 
#
# for solaris
#
  MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/solaris/ch_p4
#
# for hp
#
# MPI_LIB_PATH = 
#
#-
#
#  MPI libraries 
#
# for solaris
#
  MPI_LIBS = $(MPI_LIB_PATH) -D_REENTRANT -lmpi -lsocket -lnsl -lthread
#
# for sgi
#
# MPI_LIBS = $(MPI_LIB_PATH) -lmpi -lpthread 
#
# for hp
# MPI_LIBS = -lpthread
# MPI_LIBS = $(MPI_LIB_PATH) -lpthread 
#
#-
#
#  MPI include path
#
# MPI_INCLUDE_DIR = 
  MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
#
#-

The spooles.a library source is packaged with ccx and static linked. Would a 
build dependency on mpich suffice? 

Thanks,
Mark