Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.programmer > #5140 > unrolled thread

fortran 90+ with autotools to place mod file in src dir

Started byRudra Banerjee <bnrj.rudra@gmail.com>
First post2014-02-28 04:08 -0800
Last post2014-03-01 20:50 +0000
Articles 6 — 3 participants

Back to article view | Back to comp.unix.programmer


Contents

  fortran 90+ with autotools to place mod file in src dir Rudra Banerjee <bnrj.rudra@gmail.com> - 2014-02-28 04:08 -0800
    Re: fortran 90+ with autotools to place mod file in src dir Kaz Kylheku <kaz@kylheku.com> - 2014-02-28 16:01 +0000
    Re: fortran 90+ with autotools to place mod file in src dir Rudra Banerjee <bnrj.rudra@gmail.com> - 2014-03-01 01:57 -0800
      Re: fortran 90+ with autotools to place mod file in src dir Jorgen Grahn <grahn+nntp@snipabacken.se> - 2014-03-01 11:53 +0000
        Re: fortran 90+ with autotools to place mod file in src dir Kaz Kylheku <kaz@kylheku.com> - 2014-03-01 21:09 +0000
      Re: fortran 90+ with autotools to place mod file in src dir Kaz Kylheku <kaz@kylheku.com> - 2014-03-01 20:50 +0000

#5140 — fortran 90+ with autotools to place mod file in src dir

FromRudra Banerjee <bnrj.rudra@gmail.com>
Date2014-02-28 04:08 -0800
Subjectfortran 90+ with autotools to place mod file in src dir
Message-ID<bb39b2b2-1a17-4b25-bb2a-3aedcc51e7d3@googlegroups.com>
I am compilling my fortran code with autotools:

$ automake --version
automake (GNU automake) 1.13.4
$ autoconf --version
autoconf (GNU Autoconf) 2.69
My problem is that it writes the .mod files in the main directory(where the executable also is.)

$ tree src/ *.mod configure* Makefile*
src/
├── constants.f90
├── constants.o
├── dirac.f90
├── main.f90
├── main.o
constants.mod [error opening dir]
mdirac.mod [error opening dir]
configure [error opening dir]
configure.ac [error opening dir]
Makefile [error opening dir]
Makefile.am [error opening dir]
Makefile.in [error opening dir]


my configure.ac is:

#AC_PREREQ(2.69)
AC_INIT([kkr], [0.1],
    [],
    [kkr],
    [])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 subdir-objects foreign])

#GETTEXT_PACKAGE=AC_PACKAGE_NAME    

# Checks for programs.
#AC_PROG_CC
FCFLAGS="-fopenmp -O3"
AC_PROG_FC([ifort gfortran])

AC_CONFIG_FILES([
         Makefile
         ])
AC_OUTPUT

and Makefile.ac is:

bin_PROGRAMS = dirac
kkr_SOURCES =src/constants.f90 src/main.f90 src/dirac.f90 
src/constants.o : src/constants.f90 
src/dirac.o : src/dirac.f90 src/constants.o src/util.o 
src/main.o : src/main.f90 src/dirac.o src/constants.o   
kkr_LDADD = 
EXTRA_DIST= autogen.sh
CLEANFILES =*.mod 

But it will be better if those .mod files are in some other places (may be in src itself). How can I achieve that?

NB: filenames may have some mismatch, with tree and makefile, as I am cut-pasting to provide a minimal example of the scenario. Hope, that does not matter.

[toc] | [next] | [standalone]


#5141

FromKaz Kylheku <kaz@kylheku.com>
Date2014-02-28 16:01 +0000
Message-ID<20140228075625.648@kylheku.com>
In reply to#5140
On 2014-02-28, Rudra Banerjee <bnrj.rudra@gmail.com> wrote:
> My problem is that it writes the .mod files in the main directory(where the executable also is.)

Of course, the user of GNU Autoshit never realizes what his real problem is;
that knowledge is invariably the sole privilege of downstream users.

Just write a clean Makefile, and a clean script by hand that detects what you
need from the system, and bangs off a few variables into a config.make that is
included in your Makefile.

[toc] | [prev] | [next] | [standalone]


#5142

FromRudra Banerjee <bnrj.rudra@gmail.com>
Date2014-03-01 01:57 -0800
Message-ID<ed97c339-fc7c-41a3-bbea-45f0c45cf3bc@googlegroups.com>
In reply to#5140
"I cant solve your problem, you do it the ***** way I do it"
utter shit and disgusting. 
People uses groups for discuss problem, not to listen to to your shit ways of doing things.

[toc] | [prev] | [next] | [standalone]


#5143

FromJorgen Grahn <grahn+nntp@snipabacken.se>
Date2014-03-01 11:53 +0000
Message-ID<slrnlh3iii.81f.grahn+nntp@frailea.sa.invalid>
In reply to#5142
On Sat, 2014-03-01, Rudra Banerjee wrote:
> "I cant solve your problem, you do it the ***** way I do it"
> utter shit and disgusting. 
> People uses groups for discuss problem, not to listen to
> to your shit ways of doing things.

You're responding to Kaz' suggestion to avoid autotools.

- Often, the right answer to "I have a problem using Foo" is
  "use Bar instead".
- An answer on Usenet is not just directed to the person with
  the problem, but partly to other readers too.
- As the saying goes in .se: if someone gives you a horse
  for free, don't check its teeth [to establish its value]

Like Kaz I stay clear of Autotools, so I cannot help. Sorry.

/Jorgen

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .

[toc] | [prev] | [next] | [standalone]


#5147

FromKaz Kylheku <kaz@kylheku.com>
Date2014-03-01 21:09 +0000
Message-ID<20140301130127.178@kylheku.com>
In reply to#5143
On 2014-03-01, Jorgen Grahn <grahn+nntp@snipabacken.se> wrote:
> On Sat, 2014-03-01, Rudra Banerjee wrote:
>> "I cant solve your problem, you do it the ***** way I do it"
>> utter shit and disgusting. 
>> People uses groups for discuss problem, not to listen to
>> to your shit ways of doing things.
>
> You're responding to Kaz' suggestion to avoid autotools.
>
> - Often, the right answer to "I have a problem using Foo" is
>   "use Bar instead".

Here is an example of my shit ways:

http://www.kylheku.com/cgit/txr/tree/configure
http://www.kylheku.com/cgit/txr/tree/Make

Nice, self-contained, hand-written, maintainable config system, that works in
GNU/Linuxes, Cygwin, MingGW and OS/X Lion.

BSD-licensed: feel free to steal it and customize.

[toc] | [prev] | [next] | [standalone]


#5146

FromKaz Kylheku <kaz@kylheku.com>
Date2014-03-01 20:50 +0000
Message-ID<20140301124238.816@kylheku.com>
In reply to#5142
On 2014-03-01, Rudra Banerjee <bnrj.rudra@gmail.com> wrote:
> "I cant solve your problem, you do it the ***** way I do it"

Ah, but I don't have to solve your problem, because it is your problem.

I don't create such problems for myself.

Prevention and avoidance are the best ways to solve a problem, if they
are available. (Which they are, in this case.)

> utter shit and disgusting. 

What's disgusting is what people do to their probjects when they introduce
GNU Autocrap.

> People uses groups for discuss problem, not to listen to to your shit ways of
> doing things.

But I don't have to ask how to get my "shit ways" to work, do I.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.unix.programmer


csiph-web