Installation Problems in cmdstan 2.14 on mac: string: No such file or directory

364 views
Skip to first unread message

Lu Zhang

unread,
Feb 2, 2017, 5:44:03 AM2/2/17
to Stan users mailing list

Hi everyone,

    I failed to install CmdStan 2.14 on my computer. The error report I got is as follows:

g++ -I src -I stan/src -I usr/include -isystem stan/lib/stan_math/ -isystem stan/lib/stan_math/lib/eigen_3.2.9 -isystem stan/lib/stan_math/lib/boost_1.62.0 -isystem stan/lib/stan_math/lib/cvodes_2.9.0/include -Wall -DEIGEN_NO_DEBUG  -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DNO_FPRINTF_OUTPUT -pipe  -Wno-unused-function   -c -O3 -o bin/cmdstan/stanc.o src/cmdstan/stanc.cpp


In file included from stan/src/stan/command/stanc_helper.hpp:4:0,


                 from src/cmdstan/stanc.cpp:1:


stan/src/stan/version.hpp:4:18: fatal error: string: No such file or directory


 #include <string>


                  ^


compilation terminated.


make: *** [bin/cmdstan/stanc.o] Error 1


I included folder usr/include which has string.h, but it didn't solve the problem. My operating system is OS X EI Capitan

Thanks,

Lu Zhang

Daniel Lee

unread,
Feb 2, 2017, 9:23:18 AM2/2/17
to stan-...@googlegroups.com
Hi Lu, 

It looks like you don't have a complete installation. Did you git clone CmdStan? If so, you have to follow these directions: https://github.com/stan-dev/cmdstan/wiki/Getting-Started-with-CmdStan

Hopefully that's the issue. If not, perhaps tell us how you grabbed CmdStan. 



Daniel
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Betancourt

unread,
Feb 2, 2017, 9:35:22 AM2/2/17
to stan-...@googlegroups.com
Also, it would help to send a full report of your local computing environment
and compilers.  You’re calling g++ which already is interesting, and the string 
error often arises with compilier/core library mismatches.

Daniel Lee

unread,
Feb 2, 2017, 11:45:54 AM2/2/17
to stan-...@googlegroups.com
Michael is right; I don't think I read the error correctly. 

That does look like a library issue. 

Can you type 'g++ -v' and report the result?


Daniel

Lu Zhang

unread,
Feb 3, 2017, 1:40:38 AM2/3/17
to Stan users mailing list
Thank yo so much! This is the result of 'g++ -v':

s-149-142-31-228:cmdstan luzhang$ g++ -v

Using built-in specs.

COLLECT_GCC=g++

COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper

Target: x86_64-apple-darwin14.0.0

Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran

Thread model: posix

gcc version 4.9.2 20141029 (prerelease) (GCC) 

Daniel Lee

unread,
Feb 3, 2017, 8:36:10 AM2/3/17
to stan-...@googlegroups.com
I'll try to reproduce on a Windows machine today. That shouldn't be happening. 


Daniel

Michael Betancourt

unread,
Feb 3, 2017, 9:38:37 AM2/3/17
to stan-...@googlegroups.com
It looks like Lu’s on a Mac, which makes the default to g++
even weirder as clang should be called be default on OS X.

Daniel Lee

unread,
Feb 3, 2017, 12:07:57 PM2/3/17
to stan-...@googlegroups.com
I'm definitely not thinking straight. 

Lu, did you change anything in your make/local file?


Daniel

Lu Zhang

unread,
Feb 3, 2017, 12:56:32 PM2/3/17
to stan-...@googlegroups.com
I got the same error report before I edited the makefile. Let me update my system and redo it again. I will let you know the result later. Thank you very much!

Best,

Lu Zhang

To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/oQ72aQH2TdM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.

Lu Zhang

unread,
Feb 5, 2017, 6:19:13 PM2/5/17
to Stan users mailing list
Hi Daniel and Michael,

    I updated my system into macOS Sierra Version 10.12.3, Xcode into 8.3, and redo the whole process from "git clone CmdStan". But I still got the same error report. Then I changed the option CC in makefile from g++ into clang++ and finally built CmdStan successfully.  I think maybe CmdStan can only be compiled by clang++ on OS X. 
##
# Users should only need to set these three variables for use.
# - CC: The compiler to use. Expecting g++ or clang++.
# - O: Optimization level. Valid values are {0, 1, 2, 3}.
# - AR: archiver (must specify for cross-compiling)
# - OS: {mac, win, linux}. 
##
#CC = g++
CC = clang++

Thank you for all your help!

Lu Zhang

Daniel Lee

unread,
Feb 5, 2017, 11:32:52 PM2/5/17
to stan-users mailing list
Hi Lu,

I don't know where you got that g++ and how it's configured. When I type `g++ -v` from the command line, I get:
$ g++ -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

This is the one installed with XCode.

Did you install your g++ 4.9.3 prerelease from homebrew or macports? Maybe `which g++` will help us find out where that is.



Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

Lu Zhang

unread,
Feb 6, 2017, 1:54:19 AM2/6/17
to stan-...@googlegroups.com
Hi Daniel,
    
    Yes, I remember I got g++ from homebrew. I also have macports. 

Best,

Lu Zhang

--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/oQ72aQH2TdM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages