# Cannot rebuild rrdtool after upgrading Perl



## jontheil (Nov 27, 2014)

I upgraded Perl to perl5.18 according to the UPDATING file. When I try to update all dependent ports (I use the portupgrade approach), I have a problem with rrdtool.
The installation hangs forever with the message 
	
	



```
checking if msync with MS_ASYNC updates the files mtime...
```
I have no clue what the problem might be.
Can anyone give me an idea?
PS My system is FreeBSD 10.0-RELEASE on AMD64.
Thanks in advance!

Regards Jon Theil Nielsen


----------



## talsamon (Nov 27, 2014)

I don't know if it helps, I found in the net (but they are older posts):


> Add before the configure inside rrd directory (should be work/)
> echo "rd_cv_ms_async=ok" >> work/config.cache
> and add to configure --cache-file=config.cache   (should be CONFIGURE_ARGS="--cache-file=config.cache")



(this one compiles on my system only with perl-modules=off).

Another one:
compile it with MAKEFLAGS="-j1"

I can't test it, cause I can't repeat the error.


----------



## talsamon (Nov 28, 2014)

I forgot, if you try the first hack you have put it in the Makefile:


```
@${REINPLACE_CMD} -E 's|(^rrdcached_LDADD = librrd_th.la)|\1 $$\(ALL_LI
BS\)|' \
  ${WRKSRC}/src/Makefile.in

  @${REINPLACE_CMD} -E 's|(^rrdtool_LDADD = librrd.la)|\1 $$\(ALL_LIBS\)|
' \
  ${WRKSRC}/src/Makefile.in
==>
  ${MKDIR} work/
  echo "rd_cv_ms_async=ok" >> work/config.cache
```

(_be_cause `configure` will overwrite config.cache).


----------



## jontheil (Nov 28, 2014)

Thanks a lot for your suggestions.

Unfortunately, I am not very good at dealing with the details of port structure.
I tried your second approach by setting the variable MAKEFLAGS="-j1" by a simple env setting. I didnt't seem to work (or maybe I did it the wrong way).

The edit of the Makefile doesn't work right. Should I just copy the code and put it somewhere in the Makefile? Or should I use a different approach?

Last but not least: I don't understand the origin of the problem. I have installed rrdtool previously on the exact same system. Of course I have made minor updates and especially I have upgraded perl. But I don't see why that should break the installation. And if I have to change the Makefile, then the problem would come back with the next ports upgrade.

BTW, would it be possible for you to help me and upload the edited version of the Makefile?


----------



## talsamon (Nov 28, 2014)

The command is 
	
	



```
make install clean MAKEFLAGS="-j1"
```


I have put it in the place where I marked with the arrow. Only the two lines under the arrow. (Don't copy the arrow). And compile it with `make install clean CONFIGURE_ARGS+="--cache-file=config.cache"`
It's a test, and it seems some people have problems with it (likely in past-versions). The posted solutions are to uncomment this test. But it's more complicated than this "try". This hack returns to the test "ok".


----------



## jontheil (Nov 28, 2014)

Now I eventually got methods to work. But unfortunately, the result is exactly the same:

```
Resolve Portability Issues
checking tm_gmtoff in struct tm... yes
checking __tm_gmtoff in struct tm... no
checking if msync with MS_ASYNC updates the files mtime...
```
And after that NOTHING more. I guess I must have introduced some problem on my system. Again I have no clue...


----------



## drhowarddrfine (Nov 28, 2014)

I just upgraded Perl, too, and now vim can't find libperl.so. I think I've run into this in the past and it's an easy fix but I haven't looked for it yet. Probably related.


----------



## talsamon (Nov 28, 2014)

I have posted above it doesn't works with perl_modules option. Now, I see does. Try it, set it to on.


----------



## jontheil (Nov 28, 2014)

And how do I do that?


----------



## talsamon (Nov 28, 2014)

`make config`, there is a menu. Or simpler type `make rmconfig` (this go back to the defaults, and `perl_modules` is default on). But before update perl. It's been updated in last 24 hours four or five times, maybe it could effect something.


----------



## jontheil (Nov 28, 2014)

Yeah, but for databases/rrdtool they are already on...


----------



## talsamon (Nov 28, 2014)

Another try: try it, with the option MMAP to off.


----------



## jontheil (Nov 28, 2014)

Doesn't make any difference.
I suspect it must be an error associated with perl itself. Reading the last days updates to UPDATING implies that. Maybe the error will be corrected one of these days. But actually I need everything to be working - including rrdtool.
And I can't find a way to update all the perl dependant ports at the moment (apart from doing it for every single module which seems like a tremendous amount of work.
Another option is to downgrade perl, but that seems like a waste of a lot of time...


----------



## talsamon (Nov 28, 2014)

Much work ?
bash:
old
`sudo portmaster $(pkg info -r perl5|sed 's/\([^.]*\)-.*/\1/g')`
new
`sudo portmaster $(pkg query %rn perl5)`
csh:
old
`sudo portmaster `(pkg info -r perl5|sed 's/\([^.]*\)-.*/\1/g')``
new
`sudo portmaster `(pkg query %rn perl5)``

;-))


----------



## wblock@ (Nov 28, 2014)

Guys, stop throwing things at it for a second.  Run `pkg_libchk` or `pkg_libchk -qo` (from sysutils/bsdadminscripts).  The first will show ports that are missing libraries, look for ones that are missing libperl.so.

Note that the original UPDATING instructions showed two ways to update things after upgrading the Perl port.  The first just ran `portmaster p5-`.  That will rebuild all the Perl ports installed, but not necessarily rebuild things that depend on Perl directly.  The second one, `portmaster perl5-` rebuilds everything that depends on Perl, and probably will fix any problems.

PS: -j can just be included with the make(1) command: `make -j1 install`.


----------



## drhowarddrfine (Nov 28, 2014)

Actually it's `portmaster -r perl5-` and that fixed it for me.


----------



## jontheil (Nov 29, 2014)

Okay, the problem is solved. I don't know the exact nature of the problem. But it has been a very long time since I restarted the system. In fact, I was not able to do it by a normal reboot command. I had to make a power reset, which in turn forced me to run `fsck`, which showed a lot of errors. After fixing them, I was able to restart normally. And after that, I had no problems with rrdtool.
Of course I will thank you for discussing the issue and contribute with possible solutions.

Best regards


----------

