pvwatts version 5 calculator demo. sscphp.so

  • emiliocernadas@hotmail.com
  • Topic Author
More
16 May 2018 19:46 #6250 by emiliocernadas@hotmail.com
pvwatts version 5 calculator demo. sscphp.so was created by emiliocernadas@hotmail.com
Hi,
I am trying to run pvwatts version 5 calculator demo, the php that comes in the sam open source folder. When I press the button "calculate" I get this error message: Fatal error: Call to undefined function sscphp_data_create() in /www/docs/FILE_PATH/pvwatts.php on line 267

Any idea how to fix it?

Probably is because I didn`t create the "sscphp.so"

Could it be possible to have the steps needed to create the dynamic library "sscphp.so" for a mac 10.10, please

thank you very much!
Best regards

Please Log in or Create an account to join the conversation.

  • pgilman
More
17 May 2018 10:48 #6251 by pgilman
Replied by pgilman on topic pvwatts version 5 calculator demo. sscphp.so
Dear Emilio,

On a Mac, you should be able to use the code generator to create a set of files to access the SSC API via PHP.

Please see the How-to video "Generate SDK code from SAM" for a quick video demonstrating how the code generator works:

sam.nrel.gov/webinars

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • emiliocernadas@hotmail.com
  • Topic Author
More
17 May 2018 17:25 #6252 by emiliocernadas@hotmail.com
Replied by emiliocernadas@hotmail.com on topic pvwatts version 5 calculator demo. sscphp.so
Dear Paul,

Thanks for your reply. I followed your advice, and I generate the code with the tool "generate code" from sam-osx-2017-1-17-r4 version but I still couldn`t succeed. When I run the make file I got the following error message:

gcc -shared -O2 -fPIC -I/usr/include/php -I/usr/include/php/TSRM -I/usr/include/php/main -I/usr/include/php/ext -I/usr/include/php/Zend -o sscphp.so sscphp.c ./ssc.so
clang: error: no such file or directory: './ssc.so'
make: *** [sscphp.so] Error 1

I will appreciate any advise on how to fix it.

Thank yo very much

Best regards,
Emilio

Please Log in or Create an account to join the conversation.

  • emiliocernadas@hotmail.com
  • Topic Author
More
18 May 2018 08:52 #6253 by emiliocernadas@hotmail.com
Replied by emiliocernadas@hotmail.com on topic pvwatts version 5 calculator demo. sscphp.so
Dear Paul,

just in case I clarify that I am trying to run PVWatts V5 calculator web application using php file "SSC PHP extension"
Written by A.Dobos

thank you very much

best regards

Please Log in or Create an account to join the conversation.

  • sjanzou
More
22 May 2018 04:28 #6254 by sjanzou
Replied by sjanzou on topic pvwatts version 5 calculator demo. sscphp.so
The PHP wrapper in SAM is compliant with

PHP7 tested on Fedora 25 with PHP 7.0.25 and Zend 3.0.0.
PHP5 tested on CentOS 7 with PHP 5.4.16, Zend 2.4.0.

Zend extensions for PHP have changed all their calling conventions in versions other than 2.4.0 and 3.0.0.

You can find both the PHP and Zend version used by the following command in a terminal window:

php -version

Using MacOS 10.12, I see that the default PHP version is 5.6.0 with Zend 2.6.0 which is not supported by the wrapper.

Which versions of PHP and Zend are on your macOS 10.10 system?

Be sure to update the PHPDIR to point to the folder on your system with the PHP header files...


For reference, the steps to build the sscphp.so on Ubuntu 16.04 are:

1. sudo apt-get update
2. sudo apt-get install ubuntu-desktop
3. Download SAM
4. Create a PVWatts/No financial case
5. Generate PHP 7 code
6. PHP 7.2.3 and Zend 3.2.0
7. php development tool missing when test make in code generated folder
8. sudo add-apt-repository ppa:ondrej/php
9. sudo apt-get install php7.2-dev (Updates to php 7.2.4 with same Zend)
10. in code generated from SAM file, vi Makefile
11. PHPDIR=/usr/include/php/20170718 and save
12. make
13. make run

Please Log in or Create an account to join the conversation.

  • emiliocernadas@hotmail.com
  • Topic Author
More
22 May 2018 09:31 #6255 by emiliocernadas@hotmail.com
Replied by emiliocernadas@hotmail.com on topic pvwatts version 5 calculator demo. sscphp.so
Thank you very much sjanzou! I will follow those steps

Best regards!

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum