Error installation

Hi.
I am trying to install SPC Tool v5. Everything is ok until I created a user account in pgsql and when I run ./sptool_reqd_checks.sh, I got this error:

------PERL------
Perl
-DBI
-DBD-Pg
-Text-CSV

—POSTGRESQL—
PostgreSQL
Error: pg_wrapper: createlang was not found in /usr/lib/postgresql/14/bin
-PL/pgSQL

Anyone could help me how to solve it?
Best regard.

We have determined that this is a problem with Postgres 10 and later; a helper program was deprecated and then removed.

For a quick fix, comment out or remove lines 163 through 174 in init_sptooldb_v5.0.csh

set list = `$POSTGRES_BIN/createlang -l -U $SPTOOL_USER $SPTOOL_DB |

grep plpgsql` if ( “$list” =~ plpgsql ) then

echo "NOTICE: plpgsql language exists.”

else

endif

Also as a heads up, we are getting close to releasing Speciation Tool v5.1 which will incorporate all of the profiles from SPECIATE 5.1.

This release will probably happen in November.

1 Like

Thanks for your response.
I did what you said. Although the previous problem is solved, I have another problem for executing ./init_sptooldb_v5.0.csh.
I recive this when I run ./init_sptooldb_v5.0.csh:

farzad-faghihi:~/SPTOOL/Speciation-Tool-Speciation_Tool_5.0> ./init_sptooldb_v5.0.csh

SPTOOL_SRC_HOME = /home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/src
PERL_DBI = Pg
New database: SPTOOL_DB = sptoolv5_0alpha_t1
SPTOOL_USER = farzad
PERL_BIN = /usr/bin
POSTGRES_BIN = /usr/bin
/home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/import_data/speciate5.0_exports/export_profiles_2019_0826.txt_clean
/home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/import_data/speciate5.0_exports/export_species_properties_2020_0313.txt_clean
Database sptoolv5_0alpha_t1 created
CREATE SCHEMA
Shared schema created
GRANT
Create permissions granted on sptoolv5_0alpha_t1
GRANT
All permissions granted on shared schema
Defining custom functions and initializing tables. …working

Speciation Tool functions and tables successfully defined in sptoolv5_0alpha_t1.
Importing mechanisms /home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/import_data/mechanism_forImport.11Feb2020.csv
Cannot open file: /home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/import_data/mechanism_forImport.11Feb2020.csv
Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=sptoolv5_0alpha_t1 at /home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/src/import_rawdata.pl line 325.
ERROR: perl script failed for importing mechanisms file /home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/import_data/mechanism_forImport.11Feb2020.csv

How can I solve this?
@eyth.alison.
Thanks again.

There’s a mismatch between the names of the data files in the import_data directory and those specified in the Assigns.sptool file. To fix it, update the filenames for MECHANISM, MECHANISM_DESCRIPTION, and CARBONS in the Assigns.sptool file:

setenv MECHANISM $IDIR/mechanism_forImport_11Feb2020_speciate5_0_withSOAALK_13mar2020_v0.csv

setenv MECHANISM_DESCRIPTION $IDIR/sptool_mechanism_description_speciate5_0_04mar2020_v0.csv

setenv CARBONS $IDIR/carbons_all_mechanisms_speciate5_0_04mar2020_v0.csv

1 Like

@cseppan.
Thanks for your response.
I did what you said. Although the previous problem is solved, I received another error.
error.txt (3.4 KB)
Assigns.sptool.txt (4.5 KB)

Looks like there was an update to the mechanism description file, but the file in the CMAS package didn’t get updated. You can download the fixed file from the following location, then put it into the import_data directory.

https://raw.githubusercontent.com/CMASCenter/Speciation-Tool/master/import_data/sptool_mechanism_description_speciate5_0_04mar2020_v0.csv

1 Like

Thanks for your response.
I test your Idea to solve the error and it worked.

Thanks again.

Hi again.
I have problem when I run the speciation tool.these are my runctl file, output and error I received.
RUNCTL.txt (278 Bytes)
gspro.cb6_ae6_VOC.CMAQ.2021nov3.txt (229.1 KB)
error.txt (340.9 KB)
Thanks.

No one?
could someone help me? :face_with_head_bandage:

The specified MECH_BASIS is “CB6R3_AE6”, but that is not an active mechanism name. Try setting MECH_BASIS = CB6R3_AE

Thanks for your response.
@eyth.alison
I did what you recommended, but I received the same error I sent here before. of course it needs to be spoken that the UNK that were produced in gspro.cb6_ae6_voc is solved.

Apologies – I may have missed a character in my previous response – did you set MECH_BASIS to this? CB6R3_AE7

Thanks
It is ok, I set it to CB6R3_AE7.
anyway, the end of the run is written, it was completed but also before it is written unabel to open some files.

NOTICE:  ...renormalizing profile weights
NOTICE:  ...calculating moles per gram emissions
NOTICE:  ...calculating mole percent
NOTICE:  ...calculating moles per mole emissions
NOTICE:  ...summing on AQM pollutant
NOTICE:  ...calculating mole weight percent
NOTICE:  ...calculating average molecular weight by species
NOTICE:  ...calculating average molecular weight by AQM
Completed splits calculations

NOTICE:   Preparing output tables ... 
NOTICE:      ...completed nonHAP
NOTICE:      ...rename output AQM pollutants 

Completed output preparations
SUMMARY:  Number of profiles generated in run farzad12 is 2543 

Unable to open SPECIATE VP output file for writing: ../outputs/SPECIATE5_VP.IVOCP6-SVOCN1.2021Nov6.txt
Completed writing the output files for run farzad12 
Finished run_sptool.pl

can I ignore it or not ?

This may be an error that results from the outputs directory not being created prior to creating the file into that directory.
You could use something like the following command to make the outputs directory and ru-run the script.
(I can’t tell where the outputs directory needs to be created, but if you run this command from the same location where you have your run script, this may work.)

mkdir …/outputs

As Liz suggested, the program isn’t able to open the SPECIATE VP output file for writing. Your RUNCTL file explicitly sets the locations for the GSPRO and GSCNV files, e.g.

/home/farzad/SPTOOL/Speciation-Tool-Speciation_Tool_5.0/outputs/gspro.cb6_ae6_VOC.CMAQ.2021nov3.txt

The location of the SPECIATE VP output file isn’t configurable, and it tries to be written to a directory relative to the Speciation Tool’s “src” directory (…/outputs). This directory already exists as part of the Speciation Tool download package, so I’m not sure why the program can’t write to it. Maybe double-check the permissions, or if you’ve manually moved things around, make sure the outputs directory exists where expected.

Regarding the SPECIATE VP output file, I’m not sure what it’s used for (if anything). It’s not an input file needed for running SMOKE. There’s a sample output file provided in the outputs directory (outputs/SPECIATE5_VP.IVOCP6-SVOCN1.2020Mar18.txt). So it’s probably safe to ignore the error.

1 Like

Thanks for your response.
@cseppan
@lizadams
So it’s safe to ignore it.
But I wonder why the programme needs to find SPECIATE5_VP.IVOCP6-SVOCN1.2021Nov11.txt file,
of course, there is that file in the output directory as SPECIATE5_VP.IVOCP6-SVOCN1.2020Mar18.txt.

Maybe, It has not been updated but it is needed.

The file SPECIATE5_VP.IVOCP6-SVOCN1.[run_date].txt is an output file that gets created when the Speciation Tool is run. The outputs directory contains sample outputs from previous runs.

You are right.
Based on this code I have found in write_outputs.pl it should be produced but I do not know why it is not produced.

if ( $runout eq “” || $runout eq “VOC” && $runtype ne “HAPLIST” )
{
$outvoc = “…/outputs/SPECIATE5_VP.IVOCP6-SVOCN1.$runDate.txt”;
open(VOCFILE, “>$outvoc”) or die “Unable to open SPECIATE VP output file for writing: $outvoc\n”;